菜鸟教程:https://www.runoob.com/vue3/vue3-tutorial.html
中文教程:https://staging-cn.vuejs.org/guide/introduction.html
cnpm install -g @vue/cli
方式一:
vue init webpack ${project_name}
初始化过程选项:
E:\PythonProject\webpro>vue init webpack pyqt5
? Project name pyqt5
? Project description A Vue.js project
? Author CoderGaozh <891928685@qq.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm
vue-cli · Generated "pyqt5".
方式二:
注意:cnpm init @vitejs/app ${project_name}方式已经弃用;
npm create vite@latest
说明:按需 输入项目名称等;
cd ${project_dir}
cnpm install
cnpm run dev
说明:按照输出信息打开初始化页面;
DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Vue实例title>
<script src="https://cdn.staticfile.org/vue/3.0.5/vue.global.js">script>
head>
<body>
<div id="hello-vue" class="demo">
{{ message }}
div>
<script>
const HelloVueApp = {
data() {
return {
message: 'Hello Vue!!'
}
}
}
Vue.createApp(HelloVueApp).mount('#hello-vue')
script>
body>
html>
引入方式有3种:
A:下载到本地,在