-
Notifications
You must be signed in to change notification settings - Fork 110
2.聊天页面组件引入与环境配置
JustCoding-Hai edited this page Nov 8, 2020
·
1 revision
控制台输入命令安装需要的工具包在开发环境上:
npm install sass-loader --save-dev
cnpm install node-sass --save-dev
添加完成,package.json:
"devDependencies": {
"@vue/cli-plugin-babel": "~4.4.0",
"@vue/cli-plugin-router": "~4.4.0",
"@vue/cli-service": "~4.4.0",
"node-sass": "^4.14.1",
"sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.11"
},
新建store文件夹,store.js如下:
main.js文件中引入store.js
import store from './store/index'
new Vue({
router,
store,//这里需要注意
render: h => h(App)
}).$mount('#app')
footer