2019-02-18


                                                     小程序wxs的应用

        一,什么是wxs,

                WXS(WeiXin Script)是小程序的一套脚本语言,结合 WXML,可以构建出页面的结构。

        二 ,wxs的应用

                 创建 index .wxs文件       

                   var getImageSrc = function (imageKey) {

                             if (imageKey != null) { 

                                 return 'https://assets.xxxx.com/' + imageKey

                             } else { 

                                 return imageKey 

                             } 

                       } 

                  module.exports = { getImageSrc: getImageSrc } 

            在wxml页面引入

                    

                      

                        

你可能感兴趣的:(2019-02-18)