報(bào)錯(cuò)信息說(shuō)的很明白,hash history (瀏覽器歷史的一種) 不能保存同一個(gè) path 兩次,找到你哪個(gè)地方用了 history.push() 方法,在此之前判斷 path 是否重復(fù),或者把 hash history 換成 browser history
1.你可以把方法抽像出來(lái)寫(xiě)成一個(gè)通用的方法,然后用E6的模塊方法導(dǎo)出和引入;
2.可以寫(xiě)成mixin,在各個(gè)vue組建里面通過(guò)mixin引用
onload,或者說(shuō)是load事件表示的是“加載已完成”,如果需要加載過(guò)程中進(jìn)行回調(diào),可能需要去了解下 document.readyState 吧。
兩者都可以,如果不是一個(gè)新頁(yè)面,可以直接創(chuàng)建一個(gè)組件,這個(gè)組件也可以是一個(gè)頁(yè)面,在個(gè)人中心頁(yè)引入這個(gè)組件,然后點(diǎn)擊的按鈕觸發(fā)這個(gè)組件顯示出來(lái)。如果你想做一個(gè)新頁(yè)面,在main注冊(cè)路由,然后點(diǎn)擊按鈕跳轉(zhuǎn)到這個(gè)路由
c++ primer???
react 不支持異步組件, 建議使用 react-loadable
這個(gè)組件.
import Loadable from 'react-loadable';
routes=[
{
path: '/app/ui/buttons',
component: Loadable({
loader: () => import('../components/buttons')
})
},
{
path: '/app/ui/icons',
component: Loadable({
loader: () => import('../components/icons')
})
}
]
state 和 mutations 放在一個(gè)文件中嗎?
你可以分開(kāi)寫(xiě) state.js
export default {
wisNum: 0
}
mutations.js
export default {
SET_WISH: (state, payload) => {
state.wishNum = payload
}
}
index.js中
import state from './state.js'
import mutations from './mutations.js'
export default new Vuex.Store({
state, mutations
})
Vue組件中
this.$store.commit('SET_WISH', 12)
main.js中
import store from './store/index.js'
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>',
store
})
你好,可以問(wèn)下怎么導(dǎo)出的表格嗎?我用saver導(dǎo)出表格,blob數(shù)據(jù)是 table.innerHTML 然后類(lèi)型是 excel的類(lèi)型 導(dǎo)出的文件 打開(kāi)時(shí)候會(huì)提示 打開(kāi)的文件名不正確或者文件類(lèi)型不匹配
userLogin : `http://${ENV.ws.url}/api/login`
受到 @ymsd 的啟發(fā), 用了下面的方式, 不過(guò)不是一個(gè)正則解決的, 但也達(dá)到了需求
var str = '好好<img src="../../static/images/express/4.gif" alt="[em_4]">好研究研究這<img src="../../static/images/express/4.gif" alt="[em_4]">個(gè)方案真詳細(xì)<img src="../../static/images/express/4.gif" alt="[em_4]">1111'
var temp = str.replace(/<img.*?(?!alt=".*?")(>)/g, (match) => {
return match.replace(/<img.*?(alt="(.*?)")(>)/g, '$2')
})
結(jié)果
好好[em_4]好研究研究這[em_4]個(gè)方案真詳細(xì)[em_4]1111
"010203".match(/\d{2}/g);
或者
"010203".split(/\B(?=(?:\d{2})+\b)/);
或者
"010203".split(/\B(?=0)/);
父組件?子組件 的通信方式,解決你的問(wèn)題 Demo
或者使用第三方狀態(tài)管理庫(kù)(redux, mobx...)
change 事件寫(xiě)在methods:{} 里面了嗎
設(shè)置個(gè)臨時(shí)數(shù)組,遍歷的時(shí)候遍歷這個(gè)臨時(shí)數(shù)組,不知這樣能否滿(mǎn)足你的需求。
<ul class="obvers_ul">
<li class="pro_li" v-for="(item,index) in templist" v-show="fruitSearch" @click="exactContent(item)">
{{item}}
</li>
</ul>
search:function () {
var cus_tname=$("#search_name").val();
this.templist = [];
for(var i=0;i<this.fruitList.length;i++){
if(this.fruitList[i].indexOf(cus_tname)>=0){
console.log(this.fruitList[i]+"符合的");
this.templist.push(this.fruitList[i]);
}else {
console.log(this.fruitList[i]+"不符合的")
}
}
},
你在瀏覽器上提取是在渲染完畢的頁(yè)面上提取的,代碼里請(qǐng)求的結(jié)果是原始的response,你應(yīng)該在瀏覽器network里看對(duì)應(yīng)請(qǐng)求的原始response結(jié)果,根據(jù)這個(gè)結(jié)果來(lái)提取。
element里面是有個(gè)filelist數(shù)組的,里面是包含你上傳的文件列表,你想要?jiǎng)h除同步,只需要在你自己push的數(shù)組里刪除之后,將filelist數(shù)組里面的對(duì)應(yīng)數(shù)據(jù)刪除就ok
array = [array[1]] 最簡(jiǎn)單了
webpack配置文件
var path=require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
var utils = require('./utils'); // 引入獲取文件路徑的函數(shù)
var ROOT = utils.fullPath('../'); // 獲取頂層文件的路徑
console.log(ROOT)
module.exports={
entry:'./src/entry/main.js',
output:{
path: ROOT + '/dist',
filename:'bundle.js'
},
loader: {
rules: [{
test: /\.js[x]?$/,
loader: 'babel-loader',
exclude: /node_modules/
}]
},
resolve: {
extensions: [".js", ".jsx"]
},
plugins: [new HtmlWebpackPlugin({
title: 'mobx-demo222',
template: './src/entry/index.html',
inject: 'head'
})]
}
【破案】查出原因了,用的 scss標(biāo)簽 <style lang="scss" scoped>的scoped干擾了,去掉scoped,偽類(lèi)正常出現(xiàn)。而刪除 scoped屬性、可以以組件為單位、對(duì)樣式進(jìn)行id劃分:(以下為示例)
#xxx {
.yyy {...}
EE.zzz {...}
...
}
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專(zhuān)業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dò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ù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。