关于Html使用CDN引入ElementUI-Plus与Vue3(组合式)不生效解决方法
新版的需要挂载一下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link href="https://cdn.bootcdn.net/ajax/libs/element-plus/2.3.12/index.min.css" rel="stylesheet">
<script src="https://cdn.bootcdn.net/ajax/libs/vue/3.3.4/vue.global.prod.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/element-plus/2.3.12/index.full.js"></script>
</head>
<body>
<div id="app">
<el-button>{{message}}</el-button>
</div>
</body>
<script>
const { createApp, ref } = Vue
createApp({
setup () {
const message = ref('Hello vue!')
return {
message,
}
}
}).use(ElementPlus).mount('#app')
</script>
</html>
需要.use(ElementPlus)
评论 (0)