1.使用componenent的好處
符合高內聚,低耦合。一個組件出問題了,不會影響其他組件。
2.vue版本決定了一些使用框架的版本
vue2使用的路由版本只能到3
3.路由的配置介紹一下
a.安裝路由的插件 npm install vue-router@3
b.整理文件路徑?
將路徑整理成一個數組
route:[
{path:'/',redirect:'/login'}
]
c.啟動頁面要有
<router-view></router-view>
d.main.js界面
要引用整理好的路由管理文件
并且綁定
import Vue2 from 'vue'
import App2 from './App.vue';
import Ant from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
//import router from './router/index.js';//和下面的效果一致
import router from './router'Vue2.config.productionTip = false
Vue2.use(Ant);
new Vue2({router,render: h => h(App2),
}).$mount('#app')
4.路由地址跳轉的方法發
this.$router.push();
5.路有還可以有子路由
{
? ? ? ? path:'/tabs',
? ? ? ? componet:tabs,
? ? ? ? children:[
? ? ? ?路徑1(格式參考父路徑),
? ? ? ? 路徑2
????????]
}
6.介紹一下v-model
vue數據雙向綁定的指令
7.介紹一下v-show
控制元素或組件顯示或隱藏的指令,通過css樣式控制
8.介紹一下v-if
控制元素或組件的顯示或銷毀,跟v-show不一樣,v-if是通過插入或銷毀的方式,進行控制
9.介紹一下v-bind
動態綁定html的屬性,class,style
v-bind:style="{'font-sizez':size+'px'}",
v-bind的簡寫,就是對屬性動態賦值的簡寫
<div :class="class">
10.vue的消息提醒有哪些
this.$message.success("Success");
this.$message.warn("Warning");
this.$message.error("Error");