目測你的 node-key 設(shè)置錯(cuò)誤。
文檔:
分別通過 default-expanded-keys 和 default-checked-keys 設(shè)置默認(rèn)展開和默認(rèn)選中的節(jié)點(diǎn)。需要注意的是,此時(shí)必須設(shè)置 node-key ,其值為節(jié)點(diǎn)數(shù)據(jù)中的一個(gè)字段名,該字段在整棵樹中是唯一的。
官方示例:
<el-tree
:data="data2"
show-checkbox
node-key="id"
:default-expanded-keys="[2, 3]"
:default-checked-keys="[5]"
:props="defaultProps">
</el-tree>
<script>
export default {
data() {
return {
data2: [{
id: 1,
label: '一級 1',
children: [{
id: 4,
label: '二級 1-1',
children: [{
id: 9,
label: '三級 1-1-1'
}, {
id: 10,
label: '三級 1-1-2'
}]
}]
}, {
id: 2,
label: '一級 2',
children: [{
id: 5,
label: '二級 2-1'
}, {
id: 6,
label: '二級 2-2'
}]
}, {
id: 3,
label: '一級 3',
children: [{
id: 7,
label: '二級 3-1'
}, {
id: 8,
label: '二級 3-2'
}]
}],
defaultProps: {
children: 'children',
label: 'label'
}
};
}
};
</script>你確定你的項(xiàng)目里面有package.json文件
直接寫 [res], js 要怎么知道這個(gè) res 指的是什么?
要知道,對于 js 解析器來說,watch.number: [res] 和 methods.res 里完全就聯(lián)系不到一起。
Vue 再牛逼也不能超出 js 語法的表達(dá)能力吧,所以這個(gè)監(jiān)聽的寫法只是 Vue 會幫你去 methods 里找有沒有能對應(yīng)上的函數(shù)罷了。
$.ajax({
....
data: data1,
....
});import React, {Component} from 'react';
import PropTypes from 'prop-types';
class Tree extends Component {
static propsTypes = {
dataSource: PropTypes.shape({
name: PropTypes.string,
id: PropTypes.string,
}),
};
get getChildren() {
return this.props.dataSource.map(item => {
<TreeNode key={`tree-${item.id}`} label={item.name} id={item.id}/>;
});
}
render() {
return (
<div className={'tree'}>
{this.getChildren}
</div>
);
}
}
class TreeNode extends Component {
static propsTypes = {
label: PropTypes.string,
id: PropTypes.string,
};
state = {
loadData: false,
close: true,
};
data = {
list: [],
};
async loadData() {
this.data.list = [];
}
async open() {
let {loadData, close} = this.state;
if (!loadData) {
await this.loadData();
loadData = true;
}
this.setState({
loadData,
close: !close,
});
}
get getChildren() {
return this.data.list.map(item => {
<TreeNode key={`tree-${item.id}`} label={item.name} id={item.id}/>;
});
}
render() {
const {label} = this.props;
const {list} = this.data;
return (
<div onClick={this.open.bind(this)} className={'tree-node'}>
{label}
{list.length > 0 ? this.getChildren : ''}
</div>
);
}
}
大概就是這個(gè)樣子了,后續(xù)你還要增加樣式,還有判斷是否有下級類目,有的話允許展開,沒有就是最后一級
我這邊是有的,只不過是在input失去焦點(diǎn)之后出現(xiàn)的。
要想馬上出現(xiàn),可以使用watch
watch: {
resourcesname: function (newval,oldval) {
if (this.resourcesname != "") {
this.errname = "";
} else {
this.errname = "用戶名不能為空";
}
}
},如果是刷新導(dǎo)致無法獲取的話,那很可能是過期了,圖片上貌似是1分鐘的過期時(shí)間。
get請求的參數(shù)本來就是寫在url里,只是拼接的工作 axios 幫你做了。
不會是死循環(huán),將會返回NaN 對象隱式轉(zhuǎn)換為Number是下面流程
第一步: 調(diào)用 valueOf(), 如果返回基本類型,按照基本類型轉(zhuǎn)換規(guī)則。 不執(zhí)行第二步
第二步: 調(diào)用 valueOf()返回的是自身,就調(diào)用toString,那么返回的字符串一般是"[object XXXX]"。 再對字符串進(jìn)行基本規(guī)則轉(zhuǎn)換,也就是 NaN
https://segmentfault.com/a/11...
因?yàn)闆]匹配到啊
前對對密碼是不會加密的,基本都是sha256(salt + password)存儲在數(shù)據(jù)庫,每次前端傳password過來,后端那算出來的哈希值和數(shù)據(jù)庫的值進(jìn)行對比驗(yàn)證
而且基于https傳輸秘鑰沒有問題,即使中間人攻擊,拿到的也是密文
可以通過window.name=document.cookie在你的frame中alert(wimdow.name)
@keyframes dialog-fade-in {
0% {
transform: translate3d(0, 100%, 0);
opacity: 0;
}
100% {
transform: translate3d(0, 0, 0);
opacity: 1;
}
}
@keyframes dialog-fade-out {
0% {
transform: translate3d(0, 0, 0);
opacity: 1;
}
100% {
transform: translate3d(0, -100%, 0);
opacity: 0;
}
}
在你需要的地方復(fù)寫這兩個(gè)動畫就行了。
附上完整的代碼:
<template>
<div>
<el-dialog :visible.sync="isShown">
<div> 111111 </div>
</el-dialog>
<el-button type="primary" @click="changeStatus">顯示或隱藏</el-button>
</div>
</template>
<script>
export default {
data () {
return {
isShown: false
}
},
methods: {
changeStatus: function () {
if (this.isShown) {
this.isShown = false
} else {
this.isShown = true
}
}
}
}
</script>
<style>
@keyframes dialog-fade-in {
0% {
transform: translate3d(0, 100%, 0);
opacity: 0;
}
100% {
transform: translate3d(0, 0, 0);
opacity: 1;
}
}
@keyframes dialog-fade-out {
0% {
transform: translate3d(0, 0, 0);
opacity: 1;
}
100% {
transform: translate3d(0, -100%, 0);
opacity: 0;
}
}
</style>
參考源碼:https://github.com/ElemeFE/el...,由于dialog已經(jīng)使用了動畫效果,你只需要在這個(gè)基礎(chǔ)上去覆蓋源碼的動畫即可。這是我想出來的辦法,若其他人有其他辦法歡迎交流。
直接用npm安裝依賴包就行了,安裝好之后不用配置,自動會編譯
npm i sass-loader -D / npm i node-sass -D
參考: https://github.com/Meituan-Dianping/mpvue/issues/232
懷疑你們的這幾個(gè)文件返回了
<html>
404
</html>navigationOptions:({navigation}) => ({
tabBarLabel: '學(xué)習(xí)',
tabBarIcon: ({tintColor,focused}) => (
<TabBarItem
tintColor={tintColor}
focused={focused}
normalImage={require('./images/nav_study.png')}
selectedImage={require('./images/nav_study_select.png')} />*/
),
...
}), 這樣寫才對
感覺mouse移入移出事件大概率發(fā)生在click事件之前,很有可能你clicked這個(gè)樣式優(yōu)先級不夠高,加個(gè)!important試試?
用 package.json 改
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。