修复了一个书中的引用错误,完成了一个hello-vue的示例

main
RogerWork 1 year ago
parent 2959ad0af4
commit 73dcc76ec8
  1. 36
      demo/hello-vue.html
  2. 2
      src/main.js

@ -0,0 +1,36 @@
<!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">
<title>Hello-Vue</title>
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css"/>
<script src="https://unpkg.com/vue@3.2.24/dist/vue.global.js"></script>
<script src="https://unpkg.com/element-plus"></script>
</head>
<body>
<div id="app">
<h1>{{ title }}</h1>
<el-button type="primary" @click="add">点我</el-button>
<p>计数 {{ count }}</p>
</div>
<script type="text/javascript">
const App = {
data() {
return {
title: "Hello Vue",
count: 0,
}
},
methods: {
add() {
this.count++;
}
}
}
Vue.createApp(App).use(ElementPlus).mount('#app')
</script>
</body>
</html>

@ -1,6 +1,6 @@
import {createApp} from 'vue'
import ElementPlus from 'element-plus' // 完整引入Element-Plus
import 'element-plus/lib/theme-chalk/index.css' // 引入样式文件
import 'element-plus/dist/index.css' // 引入样式文件
import App from './App.vue'
const app = createApp(App)

Loading…
Cancel
Save