每一個mt-tab-item
有1個id
,mt-tabbar
的v-model
綁定值等于id
時即選中。設置你的selected默認值為第一個mt-tab-item
的id
fn.apply(this, [self])
這里你傳入的參數就只有一個,當然在 fn 內取不到 b 和 c 了。
調用 fn
的時候至少應該再傳兩個參數進去?。?code>fn.apply(this, [self, b, c])。不過這里的 b 和 c 是什么我就不知道了,要看你的業(yè)務邏輯
che.items??
this.items
我覺得,你花這點時間提問,都可以寫一個demo了,何不自己寫一個看看呢?
No 'Access-Control-Allow-Origin' header is present on the requested resource.
跨域請求錯誤,要后端將響應頭Access-Control-Allow-Origin
設置成*
就好了
不知道canvas和flex布局有什么關系......
使用異步組件即可,參見 Vue 官方文檔
踩這個答案的,你的良心不會痛嗎?這個答案告訴你需要了解的概念,以及從哪里可以獲取最正確最權威的指導。
可以指出哪里需要改進,如何改進,而不是只是這么暗戳戳地踩一下嗎?
學習是你自己的事,少年
babel
只是按照你配置的環(huán)境進行轉碼了啊,所謂的轉碼其實也就是把一些瀏覽器不支持的新語法,轉換成老語法.
你的問題是問你要如何做到兼容所有版本瀏覽器嗎? 還是不知道babel
如何按照瀏覽器轉碼?
兼容所有瀏覽器只需要兼容低版本就可以了,因為js大部分特性是可以做到向下兼容的.也就是新瀏覽器仍然支持老語法.
babel按照你輸入的瀏覽器版本和其他條件,去查詢對應的js支持版本,然后找到所有條件下支持的最高級別Js版本,轉碼到該版本.轉碼過程跟瀏覽器沒有任何關系,只是在node
環(huán)境中進行.
其實你身份證號只驗證位數也不是很嚴謹,港澳臺回鄉(xiāng)證是什么樣格式的?
swiper在后臺數據沒有回來已經初始化了,swiper-slide 循環(huán) data ,加上這個 v-if=“data.length”,獲取數據了之后再渲染
你在里面的時候吧函數定義到全局就可以了
這樣
window.downloadPictureForIOS = downloadPictureForIOS;
外面就可以調用了 不過你全局調用的話 能保證相關的庫已經加載完了嗎
按需引入 iview https://www.iviewui.com/docs/...
按需引入 echarts https://github.com/ywwhack/ba...
最后建議,把這些需要按需加載的模塊放到統(tǒng)一放到一個文件里,后面好維護
已自行解決。
頂一波樓上,將日期寫到變量中,再在插件中綁定默認值這個屬性
|-src
|----actions
|--------user.js
|--------office.js
|--------index.js
|----reducers
|--------user.js
|--------office.js
|--------index.js
|----pages
|--------office.js
actions目錄中的index.js作為所有業(yè)務的集合,集中配置管理.
import * as officeActions from './office';
import * as userActions from './user';
export default {
...officeActions,
...userActions,
}
//這里的方法名稱要全局唯一
export function getOfficeList(){
return async(dispatch,getState) => {
let response = await fetch(url);
//這里的type一定要全局唯一,因為狀態(tài)變一次每個Reducer都會根據類型比對一遍
dispatch({type: 'GET_OFFICE_LIST', payLoad: response.json});
}
}
export function getOfficeInfo(id){
return async(dispatch,getState) => {
let response = await fetch(url+'?id='+id);
//這里的type一定要全局唯一,因為狀態(tài)變一次每個Reducer都會根據類型比對一遍
dispatch({type: 'GET_OFFICE_DETAIL', payLoad: response.json});
}
}
//這里的方法名稱要全局唯一
export function getUserList(){
return async(dispatch,getState) => {
let response = await fetch(url);
//這里的type一定要全局唯一,因為狀態(tài)變一次每個Reducer都會根據類型比對一遍
dispatch({type: 'GET_USER_LIST', payLoad: response.json});
}
}
Reducer目錄中的index.js 所有子狀態(tài)的集合,集中配置管理.
import {combineReducers} from 'redux';
import officeReducer from './office';
import userReducer from './user';
const appReducer = combineReducers({
office: officeReducer,
user: userReducer,
});
export default appReducer;
//初始化狀態(tài)
let initialState = {
officeList: [],
officeInfo: {
"id": "",
"parent_id": "",
"parent_ids": "",
"name": "",
},
};
const office = (state = initialState, action) => {
switch (action.type) {
//處理 類型為 GET_OFFICE_LIST 結果數據
case 'GET_OFFICE_LIST':
return Object.assign({}, state, {
officeList: action.payLoad.data
});
//處理 類型為 GET_OFFICE_DETAIL 結果數據
case 'GET_OFFICE_DETAIL':
return Object.assign({}, state, {
officeInfo: action.payLoad.data
});
default:
//如果類型為匹配到 返回當前state
return state;
}
};
export default office
import React, {Component} from 'react'
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
//以antd為例
import {Table, Tree, Row, Col, Card, Button, Spin, Modal,Icon} from 'antd';
//引入Action集合,因為很有可能某個頁面 需要調用多個子action
import Actions from '../actions';
class office extends Component {
//生命周期此次不討論
componentDidMount() {
//請求機構 數據
this.props.action.getOfficeList();
}
handleOnRowClick = (officeId)=>{
//點擊行 獲取結構詳情數據
this.props.action.getOfficeInfo(officeId);
}
render() {
<div className="tableDistance">
<Table rowSelection={rowSelection} columns={columns}
dataSource={this.props.office.officeList}//綁定機構數據并展現
bordered size="middle"
pagination={false} onRowClick={this.handleOnRowClick}
/>
</div>
}
}
//我習慣叫訂閱-訂閱Reducer/index.js集合中的需要的狀態(tài),reducer/office在這里進行綁定(數據結構具體見:initState),reducer/office數據變化這里就會變化,這里可以理解為數據源
const mapStateToProps = (state) => {
return {
office: state.office,
user:state.user
}
};
//將引入的Actions綁定,使當前展現層具備 請求數據的能力,需要什么數據,就請求對應的 方法名(這就是為什么腔調actions/office.js 中的每個action 名稱一定要全局唯一,還是那句話,這個頁面可能需要多個子action的數據能力作為數據集中展現的基礎)
const mapDispatchToProps = (dispatch) => {
return {
action: bindActionCreators(Actions, dispatch)
}
};
//最重要一步 通過react-redux 提供的 connect函數將 需要的 Reducer和Actions 綁定至 當前頁面
export default connect(mapStateToProps, mapDispatchToProps)(office);
加分號啊。老生常談了。
function test(){
}
test.prototype = function(){
console.log("test_prototype");
}; //這里加分號,否則就連成一條語句執(zhí)行了
(function(){
console.log("立即執(zhí)行函數");
})()
// 不加分號,瀏覽器就是這樣認為的:
test.prototype = (function(){
console.log("test_prototype");
})(function(){
console.log("立即執(zhí)行函數");
})()
// 也就是這樣的:
f1 = function(){
console.log("test_prototype");
};
f2 = function(){
console.log("立即執(zhí)行函數");
};
test.prototype = f1(f2)()
不用箭頭函數就行了唄 要不就new Array(10).fill(0).map(_ => console.log(this).bind([])
1.4.0 小程序開始有 WXML節(jié)點信息的API
可以通過這個來進行操作。
里面有一個boundingClientRect
不正是可以利用的API?
webpack等工具,能自動解析模塊的加載,你使用了react那么你不可能不用這個吧?。?!
在main.js里直接import '../xx.less'
所有的全局樣式都可以在這引入。
北大青鳥APTECH成立于1999年。依托北京大學優(yōu)質雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數據專業(yè)的國家
北大青鳥中博軟件學院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網學院和江蘇省首批服務外包人才培訓基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團創(chuàng)建于1999年,經過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術與教育服務機構,發(fā)展為教育服務業(yè)的綜合性企業(yè)集團,成為集合面授教學培訓、網
達內教育集團成立于2002年,是一家由留學海歸創(chuàng)辦的高端職業(yè)教育培訓機構,是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
浪潮集團項目經理。精通Java與.NET 技術, 熟練的跨平臺面向對象開發(fā)經驗,技術功底深厚。 授課風格 授課風格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
曾工作于聯(lián)想擔任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔任項目經理從事移動互聯(lián)網管理及研發(fā)工作,曾創(chuàng)辦藍懿科技有限責任公司從事總經理職務負責iOS教學及管理工作。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網頁制作和網頁游戲開發(fā)。
具有10 年的Java 企業(yè)應用開發(fā)經驗。曾經歷任德國Software AG 技術顧問,美國Dachieve 系統(tǒng)架構師,美國AngelEngineers Inc. 系統(tǒng)架構師。