weex APIs

1.經過這個$vm()上下文訪問這些api在腳本的方法api

<script>
module.exports = {
    methods: {
        somemethod: function() {
            this.$vm('someId');
        }
    }
}
</script>

1.1 $(id)weex

已過期, 使用 $vm .app

1.2 $el(id)this

返回元素引用的特定的idurl

1.3 $getConfig()spa

獲取當前全局環境變量和配置信息debug

  • config(object): the object of config.
  • bundleUrl(string): the url of bundle.
  • debug(boolean): if is debug mode.
  • env(object): a object of envrioment.
    • weexVersion(string): a version of weex sdk.
    • appName(string): a name of app.
    • appVersion(string): a version of app.
    • platform(string): the platform, one of iOSAndroid and Web.
    • osVersion(string): the version of os.
    • deviceModel(string): the model of device. native only
    • deviceWidth(number): the width of device, default is 750.
    • deviceHeight(number): the height of device.
相關文章
相關標籤/搜索