Weex basis

  • Overflow: scroll is not supported
You can use <scroller> for scrollingCopy the code
  • Weex-document preview files, Android some mandatory fields.
// Android Mandatory: SRC, filename, fileType, width and height
//save indicates whether to save the file
<weex-document
    v-if="pdfSrc.length>0"
    :style="{'height': pdfHeight}"
    :src="pdfSrc"
    :filetype="filetype"
    filename="filename.pdf"
    :loadingTextColor="loadingTextColor"
    :save="save"
></weex-document>
Copy the code

The WEEX component is added

  • 1. Add components and configuration pages in the back tube first

  • 2. Configure files in code and directories

Weex debugging configuration

  • The startup page changes the startup configuration file to be obtained locally

  • Created () and Mounted () are created() and mounted(). This step is ignored.

  • The access route and the background interface address are set to the proxy (proxy is only used for local debugging).

  • In the NPM script in the lower left corner of the editor, execute serve

  • Specifying the default route

  • Access path
http://localhost:1337/#/loginpwd
Copy the code

Weex disables jump to vUE project in Android physical back key

mounted() {
    this.$nextTick(() = > {

        var platform = this.$store.state.osType;
        // console.log(platform);
        if(platform ! ="ios") {// Collin's method to disable android physics keys
            context.handleBack(true); }}); }, beforeRouteLeave (to,from, next) {
    Destroyed () restores the Android physical return key when the route leaves
    context.handleBack(false);  
    next();
},
destroyed() {  // Cancel listening while destroying
    var platform = this.$store.state.osType;
    // console.log(platform);
    if(platform ! ="ios") {
        // Restore android physics back key
        context.handleBack(false); }},Copy the code