<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!-- 引入样式 -->
<link
rel="stylesheet"
href="https://cdn.bootcdn.net/ajax/libs/element-plus/2.3.3/index.css"
rel="stylesheet"
/>
<!-- 引入vue3 -->
<script src="https://unpkg.com/vue@3"></script>
<!-- 引入element plus -->
<script src="https://cdn.bootcdn.net/ajax/libs/element-plus/2.3.3/index.full.js"></script>
<title>hello world</title>
</head>
<body>
<div id="app">
<h1>{{title}}</h1>
<el-button type="primary" @click="handleClick">点我</el-button>
<p>记数{{count}}</p>
</div>
<script type="text/javascript">
const App = {
data() {
return {
title: "Hello Vue",
count: 0,
};
},
methods: {
handleClick() {
this.count++;
},
},
};
Vue.createApp(App).use(ElementPlus).mount("#app");
</script>
</body>
</html>
vue3的cdn方式+element plus的cdn方式使用
于 2024-02-27 10:23:16 首次发布