computed:{
sum(){
return parseFloat(this.form.add1) + parseFloat(this.form.add2)
}
}
v-model = 'sum'
發(fā)送數(shù)據(jù)的時(shí)候把sum加上去
r1
<el-form-item label="實(shí)收總金額">
<el-input placeholder="實(shí)收總金額" v-model="form.sum"></el-input>
</el-form-item>
<el-form-item label="活動(dòng)性質(zhì)">
<el-checkbox-group v-model="form.type"
:max="5">
<el-checkbox v-for="(item,index) in arr"
:label="item.name"
:key="item.id"
name="type"
@change="fun(index)">
<div class="displayInput"
v-if="item.change">{{item.name}}
<span class="wrap">
<el-input placeholder="應(yīng)收金額" v-model="form.add1"></el-input>
<el-input placeholder="實(shí)收金額" v-model="form.add2"></el-input>
</span>
</div>
</el-checkbox>
</el-checkbox-group>
// js data里 把form放到arr里面
arr:[{name:'s',form:{add1:null,add2:null}}]
computed:{
sum(){
return this.arr..map(v => parseFloat(v.form.add1) + parseFloat(v.form.add2)).reduce((a, b) => a + b)
}
}
// 發(fā)送數(shù)據(jù)就要你自己組織了navigator.onLine 可以判斷網(wǎng)絡(luò)連接狀態(tài)
怎么實(shí)現(xiàn)占位傳值呢 就是文本某個(gè)位置字符需要?jiǎng)討B(tài)改變 比如:
message: {
hello: '你好'{0}
}
就是可以實(shí)現(xiàn) 你好lucy \你好Rosi 這樣的es6中的export和import相關(guān)的ES6學(xué)習(xí)——模塊化:import和export;
應(yīng)該是getters,actions,mutations中export了多個(gè)模塊,import的時(shí)候也要分開引入import {a, b} from xxx,或者import * as a from xxx
match得到的是個(gè)數(shù)組所以報(bào)錯(cuò)而且正則應(yīng)該是/^[0-9]d$|(^[0-9]+.[0-9]{0,8})/,watch檢測(cè)數(shù)據(jù)是沒問題的。用computed反而會(huì)麻煩一些
一種方案就是你在最外層,定義一個(gè)變量,let data = {};
// 回調(diào)里賦值
data.date = value;
然后把這個(gè)data 傳給后端即可呀。
HTML代碼:
<div class="ct">
<div class="left">left</div>
<div class="right">right</div>
<div class="main">main</div>
</div>
CSS代碼:
.left,
.right {
width: 100px;
height: 100px;
}
.left {
background: blue;
float: left;
}
.right {
background: green;
float: right;
}
.main {
background: red;
height: 100px;
margin: 0 100px;
}
應(yīng)該還有代碼吧?
categoryData: null, //商品分類數(shù)據(jù)
cartProductData: null, //加入的購(gòu)物車數(shù)據(jù) 看你寫的 這兩個(gè)就是保存在vuex中全局的data,
如果不是 async await請(qǐng)求數(shù)據(jù)放在組件里也可以
看錯(cuò)了,只只需要 循環(huán)一個(gè)
對(duì)的
前段靜態(tài)引入是沒問題的
<script src="https://cdn.jsdelivr.net/npm/sockjs-client@1/dist/sockjs.min.js"></script>
var sock = new SockJS('https://mydomain.com/my_prefix');
sock.onopen = function() {
console.log('open');
sock.send('test');
};
寫一個(gè)自定義的輸入框,但是不要用input,實(shí)現(xiàn)的效果和input一樣,然后自定義一個(gè)動(dòng)畫光標(biāo)效果不就行了,點(diǎn)擊某個(gè)地方,自定義的鍵盤出現(xiàn)
或許,可以這樣?
WebView 組件參考 · GitBook - http://docs.cocos.com/creator...
沒有用過這個(gè)插件,不過你可以參照:https://blog.csdn.net/wgp1573...
我看你的全局變量聲明是不是位置不對(duì)?
然后就是你有好好的引入嗎?
原來是v-for惹的貨,也就是說你一個(gè)頁(yè)面上同時(shí)有好幾個(gè)swiper,那么根據(jù)循環(huán)的index給不同的ref,重新初始化就好了.
vue-awesome-swiper
你還是改改用法吧
組件內(nèi)
<template>
<swiper :options="swiperOption">
<swiper-slide v-for="slide in swiperSlides">I'm Slide {{ slide }}</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
</template>
<script>
import { swiper, swiperSlide } from 'vue-awesome-swiper'
export default {
components: {
swiper,
swiperSlide
}
},
name: 'carrousel',
data() {
return {
swiperOption: {
pagination: {
el: '.swiper-pagination'
}
},
swiperSlides: [1, 2, 3, 4, 5]
}
},
}
</script>
<template>
<div class="content clearfix">
<div class="leftBar leftHelpBar">
<ul class="leftHelp_tab clearfix">
<li v-for="(item, tabIndex) in items" :class="{onCur: iscur == tabIndex}" @click="setCur(tabIndex)" :key="tabIndex">{{ item.name }}</li>
</ul>
<ul class="help_list" v-for="(item, i) in items" :key="i" v-show="iscur == i">
<li v-for="(item, index) in item.dataList" :key="index">
<h3>{{ item.title }}</h3>
<span v-for="(item, subIndex) in item.content"
:key="subIndex"
:class="{curStyle: `${i},${index},${subIndex}`== getcur}"
@click="postCur(`${i},${index},${subIndex}`)">
{{ item.subTit }}
</span>
</li>
</ul>
</div>
<div class="rightBar">
<div v-for="(item, i) in items" :key="i" class="help-img-con">
<div v-for="(item, index) in item.dataList" :key="index">
<div v-for="(item, subIndex) in item.content"
:key="subIndex"
v-show="`${i},${index},${subIndex}`== getcur"
v-swiper:mySwiper="swiperOption"
:ref=" `mySwiper${subIndex}` " <======= change here
:options="swiperOption">
<ul class="swiper-wrapper">
<li v-for="(item, k) in item.img" :key="k" class="help-img-list swiper-slide">
<img :src="item.imgsrc" alt="" />
</li>
</ul>
<div class="swiper-button-next" slot="button-next"></div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import axios from 'axios'
export default {
data () {
return {
iscur: 0,
getcur: '0,0,0',
swiperOption: {},
items: []
}
},
created(){
axios.get('static/data/leftHelpBase.json')
.then((res) => {
console.log(res)
this.items = res.data.dataInfo
})
.catch((err) => {
console.log(err)
})},
mounted: function () {
},
methods: {
setCur: function (index) {
this.iscur = index
this.getcur = index + ',0,0'
},
postCur: function (index) {
this.getcur = index
}
},
computed: {
swiper () {
return this.$refs.mySwiper.swiper
}
}
}
</script>
then(res => { this.xxx = xxxx })
用了vue為啥還這么干呢
@click="f(r)"這樣調(diào)用吧,函數(shù)f里面再去調(diào)用你的window下的函數(shù)吧
看你有個(gè)anguler的標(biāo)簽,如果你的fs的邏輯是寫在業(yè)務(wù)代碼(跑在純?yōu)g覽器)里的那就用不了。
ngAfterViewChecked這個(gè)hook每次在檢測(cè)組件內(nèi)部自己的視圖(view)和子組件的視圖時(shí)都會(huì)調(diào)用,頻率很高的。官網(wǎng)也說明了:
Notice that Angular frequently calls AfterViewChecked(), often when there are no changes of interest. Write lean hook methods to avoid performance problems.
你說的那個(gè)庫(kù)沒有使用過,不過refresh這種刷新邏輯一般不會(huì)頻繁的觸發(fā)吧,那只需要在需要觸發(fā)的時(shí)候收到調(diào)用就可以了呀,沒有必要寫到ngAfterViewChecked 生命周期函數(shù)中吧
jquery fileupload插件 上傳一張圖片和張圖片是一樣的
<input id="upfile" data-url="后臺(tái)提交地址" type="file" name="接口需要名稱" value="">
multiple form表單添加屬性
js注冊(cè)事件 單文件只執(zhí)行一次下面的事件 多文件執(zhí)行多次回調(diào)
$("表單名稱").fileupload({
datatype : "json",
done : function ( e , data ) {
console.log(data)
}
});VM橋接網(wǎng)卡,獲取與局域網(wǎng)同網(wǎng)段的IP,不就可以了?
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
達(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
北大課工場(chǎng)是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國(guó)家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國(guó)制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國(guó)職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(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ū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問,美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。