以下是代码
index.html代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- <link href="https://unpkg.com/ant-design-vue@3.2.2/dist/antd.min.css" rel="stylesheet"> -->
<!-- <script src="https://unpkg.com/dayjs@1.8.21/dayjs.min.js"></script>
<script src="https://unpkg.com/ant-design-vue@3.2.2/dist/antd.min.js"></script> -->
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app">
<!--app-html-->
</div>
<script type="module" src="/main.js"></script>
</body>
</html>
page页面
<template>
<page-meta page-style="color: green" root-font-size="16px">
<head>
<!-- <link href="https://primefaces.org/primevue/themes/saga-blue/theme.css" rel="stylesheet"> -->
<meta name="keyword" :content="title" />
</head>
</page-meta>
<view class="content">
<Button>aaaaaaaaaaaa </Button>
</view>
</template>
<script>
// console.info("primevue", primevue)
// import {AButton} from 'ant-design-vue'
export default {
components: {
// 'a-button': AButton
},
data() {
return {
keyword: '',
}
},
serverPrefetch() { // 仅vue3版本支持
this.keyword = "ServerKeyword"
},
}
</script>
3 个回复
VIE
我测试也不行,感觉是个BUG
mvlyforever
<meta name="keyword" :content="title" />
title 换成 keyword 试试?
DCloud_uni-ad_HDX
运行时需要在菜单勾选 启用SSR