Vux components to build mobile-phone projects

Source: Internet
Author: User

In fact, I use the Vux component of the process is like this, wow! It's so convenient!! function Good whole!! It's too easy!! Then, on the various "jumping pits". The following pit links.

1, installation vux:cnpm i-s Vux; It's better.

2. Import components:

Import {ViewBox, Xheader, Tabbar, Tabbaritem} from ' Vux '
Export Default {
Name: ' App ',
Components: {ViewBox, Xheader, Tabbar, Tabbaritem}
}

Error! The reason is that Vux internal styles are written in less, so install less-loader! first

CNPM  Install less less-loader--save

3. Using components

  <view-box>      <x-header:left-options= "{backtext: '}" title= "MACC3.0": right-options= "{showMore: ' true '} "Slot=" header ">      </x-header>      <div style=" height:650px; " >      </div>      <tabbar solt= "Bottom" >        <tabbar-item show-dot>           <span slot= "label" > Home </span>        </tabbar-item>        < Tabbar-item badge= "2" >                    <span slot= "label" > Message < /SPAN>        </tabbar-item>        <tabbar-item selected>                    <span slot=" label "> Users </span>        </tabbar-item>      </tabbar>    </view-box>

Error! The reason is that Vux has a i18n language pack component inside it and needs to be configured:

CNPM Install Vux-loader

Webpack.dev.config Add:

var vuxloader=require (' Vux-loader ') basewebpackconfig=vuxloader.merge (basewebpackconfig,{plugins:[' Vux-ui '})

View-box page container, should be height:100%, so, it's parent HTML, body, #app的height: 100%;

You can import the reset style file for Vux:

@import ' ~vux/src/styles/reset.less ';

Finally, is not feeling or not, mobile phone side! index.html Add:

<meta name= "viewport" id= "viewport" content= "Width=device-width, initial-scale=1" >

  

Vux components to build mobile-phone projects

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.