vux experience

vux experience

html+css

  • The click event of the component in vux needs to be used @click.native="", especially <x-button>, it is the easiest to forget.

    In vue, you may want to listen to a native event directly on the root element of a component many times. At this point, you can use the v-on of .nativemodifiers.

  • Let input get focus when the page is initialized:

    this.$refs.inputName.focus();
 
  • placeholder style:
    input::-webkit-input-placeholder {}
 
  • image
<img :src="require('@/assets/images/icon/icon-index.png')" alt="">
 

vue syntax

method

  • Copy a new array
var newList = JSON.parse(JSON.stringify(this.oldList));
 

vux pit

1. Call confirm in prompt form to report an error:Cannot read property 'type' of undefined

Manually initialize input-attrs~

Namely the type attribute of input, currently supports text, number, email, password, tel

this.$vux.confirm.prompt('placeholder', {
  title: 'title',
  inputAttrs: {
    type: 'text'
  },
  onCancel () {},
  onConfirm (msg) {
    console.log('msg->', msg);
  }
});
 

Vux simple components

  • LoadMore, Spinner, InlineLoading components

<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>

 
  • Password box

<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;
}