vux中組件的點擊事件要用@click.native=""
,尤爲是<x-button>
,最容易忘。javascript
vue中,你可能有不少次想要在一個組件的根元素上直接監聽一個原生事件。這時,你可使用 v-on 的 .native
修飾符。css
頁面初始化時讓input獲取焦點:html
this.$refs.inputName.focus();
複製代碼
input::-webkit-input-placeholder {}
複製代碼
<img :src="require('@/assets/images/icon/icon-index.png')" alt="">
複製代碼
var newList = JSON.parse(JSON.stringify(this.oldList));
複製代碼
Cannot read property 'type' of undefined
手動初始化input-attrs便可~vue
即input的type屬性,目前支持 text,number,email,password,teljava
this.$vux.confirm.prompt('placeholder', {
title: 'title',
inputAttrs: {
type: 'text'
},
onCancel () {},
onConfirm (msg) {
console.log('msg->', msg);
}
});
複製代碼
<style lang="scss">
</style>
<template>
<div class="test">
<group>
<cell title="當前id">
<spinner type="ios-small" v-if="!id"></spinner>
<span>{{id}}</span>
</cell>
</group>
<p style="text-align: center;padding: 10px 0;" v-if="!id">
<spinner type="ios"></spinner>
</p>
</div>
</template>
<script>
import { Spinner, Group, Cell } from 'vux'
export default {
name: "test",
components: { Spinner, Group, Cell },
data() {
return {
id: "",
}
},
mounted() {
setTimeout(() => {
this.id = '007'
}, 2000)
}
};
</script>
複製代碼
<div v-if="showModule"></div>
<!-- 輸入密碼查看 -->
<Password
v-if="showPassword"
v-bind:module-type="type"
v-bind:module-id="params.moduleId"
v-on:returnPassword="receivePassword"
></Password>
import Fold from "../Fold.vue";
import Password from '../Password.vue'
showPassword:"",
showModule(){
return !this.showPassword;
}
if (sessionStorage.getItem("successVideoPassword") == "true") {
this.showPassword = false;
}else{
this.params.moduleObject.displayAuthState==3?this.showPassword = true:this.showPassword = false;
}
//接受Password組件傳來的信息
receivePassword(res) {
this.showPassword = res;
}
複製代碼