阿里云赞助

Bootstrap

Bootstrap

Besides its default meaning, <script> tag supports two more configuration with its type property in the top level component of a page.

  • type="data": For initial data configuration, the data defined here will overwrite the data definition in the <script>.
  • type="config": For configuration definition.
<script type="data">
/* (optional) the definition of initial data */
</script>
<script type="config">
/* (optional) the definition of configuration */
</script>

Initial data definition

Sometimes, it is hard to maintain huge data structure in the default <script> tag. So Weex allows us to have a <script type="data"> tag to define initial data. The data defined in here will totally replace the data defined in the default <script> tag.

here is an example:

<script type="data">
{
title: 'Alibaba',
date: new Date().toLocaleString()
}
</script>

script configuration

Weex also allows us to do some configuration with a <script type="config">, So far, we only support the downgrade configs.

  • downgrade.osVersion
  • downgrade.appVersion
  • downgrade.weexVersion
  • downgrade.deviceModel
Apache Incubator
Disclaimer: Apache Weex is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.


ApacheCopyright(c) 2017 The Apache Software Foundation. Licensed under the Apache License, Version 2.0