weex APIs

1.通过这个$vm()上下文访问这些api在脚本的方法

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

1.1 $(id)

已过时, 使用 $vm .

1.2 $el(id)

返回元素引用的特定的id

1.3 $getConfig()

获取当前全局环境变量和配置信息

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

 

转载于:https://www.cnblogs.com/Jsonlu/p/5638714.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值