The meta module can be used to declare meta information for a single page, such as the viewport of the container.
The default width (viewport) of Weex container is 750px. The
setViewport method can change the viewport of the page and only takes effect on the current page.
Notice: The viewport must be set before the page rendering starts. In other words, the
setViewportmethod can only be used in the entry file, and before the
new Vue (...)statement. If it’s used in the component, the code is executed only when the component is being rendered, meanwhile, the page is already in the rendering process, set the viewport will not take effect again.
it is only in the rendering of the components will be implemented The corresponding code,
Referance: W3C Spec CSS Device Adaptation.
options: viewport configuration
width: Number or
height: Number or
The default unit of the width and height is
px, other units are not supported.
The entry file:
After configuring the width of the viewport to 640 in the entry.js, all the components in the current page will take 640px as full screen width.
Referance: Set up development environment.