-
開發(fā)環(huán)境:
webstorm或vscode
推薦webstorm
相關(guān)配置:
背景色:深色
font:size=16,行間距1.2
查看全部 -
記錄
查看全部 -
查看全部
-
npm 6.4.1
node 8.12.0
查看全部 -
知識(shí)圖
查看全部 -
已經(jīng)跟著敲了三遍了,最后一遍,記憶更深了。感謝老師講的,只不過只會(huì)打這些代碼,不知道用在什么地方。
查看全部 -
地址是:
npm install -g cnpm --registry=https://registry.npm.taobao.org
查看全部 -
地址是:
npm install -g cnpm --registry=https://registry.npm.taobao.org
查看全部 -
查看服務(wù)器上有的版本
nvm?
node
npm?
解決npm下載慢的問題
查看全部 -
語法
v-for
v-if
v-else
v-show
查看全部 -
說說啊啊啊啊啊啊啊啊啊啊1234556查看全部
-
學(xué)習(xí)vue制作移動(dòng)端web
查看全部 -
<template>
?<ul>
? ?<!--@click點(diǎn)擊選中樣式-->
? ?<!--:class選中樣式,僅在current等于某個(gè)索引時(shí)且current不為空時(shí)生效-->
? ?<li v-for="(item,index) in lists"
? ? ? ?@click="choose(index)"
? ? ? ?:class="{active: index == current && current !== ''}"
? ? ? ?:key="index">
? ? ?{{item}}
? ?</li>
?</ul>
?<button type="button" @click="add()">添加</button>
?<!--輸出target-->
?<ul>
? ?<li v-for="(item,index) in target" :key="index">{{item}}</li>
?</ul>
</template>
<script>
?export default {
? ?name: 'Info',
? ?data () {
? ? ?return {
? ? ? ?current: '',
? ? ? ?lists: [1,2,3,4,5,6,7,8,9],
? ? ? ?target: []
? ? ?}
? ?},
? ?methods:{
? ? ?//選中時(shí)改變current的值
? ? ?choose (index){
? ? ? ?this.current = index;
? ? ? ?console.info(index);
? ? ?},
? ? ?//點(diǎn)擊添加按鈕時(shí)把當(dāng)前選中值加到目標(biāo)數(shù)組
? ? ?add(){
? ? ? ?if(this.current === ''){ ?//為空時(shí)不添加
? ? ? ? ?return;
? ? ? ?}
? ? ? ?this.target.push(this.lists[this.current]);
? ? ? ?/*添加后清空*/
? ? ? ?this.current = '';
? ? ?}
? ?}
?}
</script>
<style scoped>
? ?/*選中的li加背景色*/
? ?li.active{
? ? ?background:green;
? ?}
</style>查看全部 -
課程安排
查看全部 -
vue通過使用var賦值,來進(jìn)行瀏覽器調(diào)試
查看全部 -
定義watch之后,對(duì)app中的msg進(jìn)行修改值后,可以觀看到值發(fā)生了變化。
通過以上,可以發(fā)現(xiàn)computed他倆展示的效果一樣,那么他們的區(qū)別在哪里?
通過上面發(fā)現(xiàn),wathch只能監(jiān)聽他自己定義的變量名。computed可以監(jiān)聽實(shí)例里面的所有值。
在computed中return了this.arr; 重新定義了arr之后,發(fā)現(xiàn)值也跟著發(fā)生變化。說明computed可以監(jiān)聽到實(shí)例后的變量。
watch:一個(gè)變量或一個(gè)常量
computed:多個(gè)變量
查看全部 -
模板語法:
查看全部 -
Demo:
<head>: 引入樣式文件、js庫(kù)等
????推薦網(wǎng)站bootcdn,引入vue的js文件
<body> script,new vue 對(duì)象
????el:綁定元素
????data: 關(guān)聯(lián)數(shù)據(jù),使用{{}}關(guān)聯(lián)具體的數(shù)據(jù)名稱?
查看全部
舉報(bào)