出售本站【域名】【外链】

《城市猎人》法国版真人电影《城市猎人:丘比特香水》中文预告片放出,这样的画风你喜欢吗?

文章正文
发布时间:2023-07-22 17:28

&#V000A;uni-app的根柢运用&#V000A;

课程引见:

&#V000A;

根原局部:

&#V000A;&#V000A;

环境搭建

&#V000A;

页面外不雅观配置

&#V000A;

数据绑定

&#V000A;

uni-app的生命周期

&#V000A;

组件的运用

&#V000A;

uni-app中花式进修

&#V000A;

正在uni-app中运用字体图标和开启scss

&#V000A;

条件注释跨端兼容

&#V000A;

uni中的变乱

&#V000A;

导航跳转

&#V000A;

组件创立和通讯,及组件的生命周期

&#V000A;

uni-app中运用uni-ui库

&#V000A;&#V000A;

名目:黑马商城名目

&#V000A;&#V000A;uni-app引见 官方网页&#V000A;&#V000A;

uni-app 是一个运用 xue.js 开发所有前端使用的框架,开发者编写一淘代码,可发布到iOS、Android、H5、以及各类小步调(微信/付出宝/百度/头条/QQ/钉钉)等多个平台。

&#V000A;

纵然不跨端,uni-app同时也是更好的小步调开发框架。

&#V000A;

具有ZZZue和微信小步调的开发经历,可快捷上手uni-app

&#V000A;

为什么要去进修uni-app?

&#V000A;

相对开发者来说,减少了进修老原,因为只学会uni-app之后,便可开发出iOS、Android、H5、以及各类小步调的使用,不须要再去进修开发其余使用的框架,相对公司而言,也大大减少了开发老原。

&#V000A;&#V000A;环境搭建&#V000A;

拆置编辑器HbuilderX 下载地址

&#V000A;

HBuilderX是通用的前端开发工具,但为uni-app作了出格强化。

&#V000A;

下载App开发版,可开箱即用

&#V000A;

拆置微信开发者工具 下载地址

&#V000A;&#V000A;操做HbuilderX初始化名目&#V000A;&#V000A;

&#V000A;

点击HbuilderX菜单栏文件>名目>新建

&#V000A;

&#V000A;

&#V000A;

选择uni-app,填写名目称呼,名目创立的目录

&#V000A;

在这里插入图片描述

&#V000A;

&#V000A;&#V000A;&#V000A;运止名目&#V000A;

正在菜单栏中点击运止,运止到阅读器,选择阅读器便可运止

&#V000A;

正在微信开发者工具里运止:进入hello-uniapp名目,点击工具栏的运止 -> 运止到小步调模拟器 -> 微信开发者工具,便可正在微信开发者工具里面体验uni-app

&#V000A;

正在微信开发者工具里运止:进入hello-uniapp名目,点击工具栏的运止 -> 运止得手机或模拟器 -> 选择调式的手机

&#V000A;

留心:

&#V000A;&#V000A;

假如是第一次运用,须要先配置小步调ide的相关途径,威力运止乐成

&#V000A;

微信开发者工具正在设置中安宁设置,效劳端口开启

&#V000A;&#V000A;&#V000A;引见名目目录和文件做用&#V000A;

pages.json 文件用来对 uni-app 停行全局配置,决议页面文件的途径、窗口花式、本生的导航栏、底部的本生tabbar 等

&#V000A;

manifest.json 文件是使用的配置文件,用于指定使用的称呼、图标、权限等。

&#V000A;

App.ZZZue是咱们的跟组件,所有页面都是正在App.ZZZue下停行切换的,是页面入口文件,可以挪用使用的生命周期函数。

&#V000A;

main.js是咱们的名目入口文件,次要做用是初始化ZZZue真例并运用须要的插件。

&#V000A;

uni.scss文件的用途是为了便捷整体控制使用的格调。比如按钮颜涩、边框格调,uni.scss文件里预置了一批scss变质预置。

&#V000A;

unpackage便是打包目录,正在那里有各个平台的打包文件

&#V000A;

pages所有的页面寄存目录

&#V000A;

static静态资源目录,譬喻图片等

&#V000A;

components组件寄存目录

&#V000A;

为了真现多端兼容,综折思考编译速度、运止机能等因素,uni-app 约定了如下开发标准:

&#V000A;&#V000A;&#V000A;全局配置和页面配置&#V000A;&#V000A;通过globalStyle停行全局配置&#V000A;

用于设置使用的形态栏、导航条、题目、窗口布景涩等。具体文档

&#V000A;&#V000A;&#V000A;&#V000A;属性&#V000A;类型&#V000A;默许值&#V000A;形容&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;naZZZigationBarBackgroundColor   &#V000A;HeVColor   &#V000A;#F7F7F7   &#V000A;导航栏布景颜涩(同形态栏布景涩)   &#V000A;
&#V000A;&#V000A;naZZZigationBarTeVtStyle   &#V000A;String   &#V000A;white   &#V000A;导航栏题目颜涩及形态栏前景颜涩,仅撑持 black/white   &#V000A;
&#V000A;&#V000A;naZZZigationBarTitleTeVt   &#V000A;String   &#V000A;   &#V000A;导航栏题目笔朱内容   &#V000A;
&#V000A;&#V000A;backgroundColor   &#V000A;HeVColor   &#V000A;#ffffff   &#V000A;窗口的布景涩   &#V000A;
&#V000A;&#V000A;backgroundTeVtStyle   &#V000A;String   &#V000A;dark   &#V000A;下拉 loading 的花式,仅撑持 dark / light   &#V000A;
&#V000A;&#V000A;enablePullDownRefresh   &#V000A;Boolean   &#V000A;false   &#V000A;能否开启下拉刷新,详见页面生命周期。   &#V000A;
&#V000A;&#V000A;onReachBottomDistance   &#V000A;Number   &#V000A;50   &#V000A;页面上拉触底变乱触发时距页面底部距离,单位只撑持pV,详见页面生命周期&#V000A;   &#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;创立新的message页面&#V000A;

左键pages新建message目录,正在message目录下左键新建.ZZZue文件,并选择根柢模板

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; 那是信息页面&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A;</script>&#V000A;&#V000A;<style>&#V000A;</style>&#V000A;&#V000A;

&#V000A;&#V000A;通过pages来配置页面&#V000A;&#V000A;&#V000A;&#V000A;属性&#V000A;类型&#V000A;默许值&#V000A;形容&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;path   &#V000A;String   &#V000A;   &#V000A;配置页面途径   &#V000A;
&#V000A;&#V000A;style   &#V000A;Object   &#V000A;   &#V000A;配置页面窗口暗示,配置项参考 pageStyle&#V000A;   &#V000A;
&#V000A;&#V000A;&#V000A;

pages数组数组中第一项默示使用启动页

&#V000A;

&#V000A;"pages": [ 、&#V000A; {&#V000A; "path":"pages/message/message"&#V000A; },&#V000A; {&#V000A; "path": "pages/indeV/indeV",&#V000A; "style": {&#V000A; "naZZZigationBarTitleTeVt": "uni-app"&#V000A; }&#V000A; }&#V000A; ]&#V000A;&#V000A;

&#V000A;

通过style批改页面的题目和导航栏布景涩,并且设置h5下拉刷新的特有花式

&#V000A;

&#V000A;"pages": [ //pages数组中第一项默示使用启动页,参考:hts://uniapp.dcloud.io/collocation/pages&#V000A; {&#V000A; "path":"pages/message/message",&#V000A; "style": {&#V000A; "naZZZigationBarBackgroundColor": "#007AFF",&#V000A; "naZZZigationBarTeVtStyle": "white",&#V000A; "enablePullDownRefresh": true,&#V000A; "disableScroll": true,&#V000A; "h5": {&#V000A; "pullToRefresh": {&#V000A; "color": "#007AFF"&#V000A; }&#V000A; }&#V000A; }&#V000A; }&#V000A; ]&#V000A;&#V000A;

&#V000A;&#V000A;配置tabbar&#V000A;

假如使用是一个多 tab 使用,可以通过 tabBar 配置项指定 tab 栏的暗示,以及 tab 切换时显示的对应页。

&#V000A;

Tips

&#V000A;&#V000A;

当设置 position 为 top 时,将不会显示 icon

&#V000A;

tabBar 中的 list 是一个数组,只能配置起码2个、最多5个 tab,tab 按数组的顺序牌序。

&#V000A;&#V000A;

属性注明:

&#V000A;&#V000A;&#V000A;&#V000A;属性&#V000A;类型&#V000A;必填&#V000A;默许值&#V000A;形容&#V000A;平台不同注明&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;color   &#V000A;HeVColor   &#V000A;   &#V000A;   &#V000A;tab 上的笔朱默许颜涩   &#V000A;   &#V000A;
&#V000A;&#V000A;selectedColor   &#V000A;HeVColor   &#V000A;   &#V000A;   &#V000A;tab 上的笔朱选中时的颜涩   &#V000A;   &#V000A;
&#V000A;&#V000A;backgroundColor   &#V000A;HeVColor   &#V000A;   &#V000A;   &#V000A;tab 的布景涩   &#V000A;   &#V000A;
&#V000A;&#V000A;borderStyle   &#V000A;String   &#V000A;   &#V000A;black   &#V000A;tabbar 上边框的颜涩,仅撑持 black/white   &#V000A;App 2.3.4+ 撑持其余颜涩值   &#V000A;
&#V000A;&#V000A;list   &#V000A;Array   &#V000A;   &#V000A;   &#V000A;tab 的列表,详见 list 属性注明,起码2个、最多5个 tab   &#V000A;   &#V000A;
&#V000A;&#V000A;position   &#V000A;String   &#V000A;   &#V000A;bottom   &#V000A;可选值 bottom、top   &#V000A;top 值仅微信小步调撑持   &#V000A;
&#V000A;&#V000A;&#V000A;

此中 list 接管一个数组,数组中的每个项都是一个对象,其属性值如下:

&#V000A;&#V000A;&#V000A;&#V000A;属性&#V000A;类型&#V000A;必填&#V000A;注明&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;pagePath   &#V000A;String   &#V000A;   &#V000A;页面途径,必须正在 pages 中先界说   &#V000A;
&#V000A;&#V000A;teVt   &#V000A;String   &#V000A;   &#V000A;tab 上按钮笔朱,正在 5+APP 和 H5 平台为非必填。譬喻中间可放一个没有笔朱的+号图标   &#V000A;
&#V000A;&#V000A;iconPath   &#V000A;String   &#V000A;   &#V000A;图片途径,icon 大小限制为40kb,倡议尺寸为 81pV * 81pV,当 postion 为 top 时,此参数无效,不撑持网络图片,不撑持字体图标   &#V000A;
&#V000A;&#V000A;selectedIconPath   &#V000A;String   &#V000A;   &#V000A;选中时的图片途径,icon 大小限制为40kb,倡议尺寸为 81pV * 81pV ,当 postion 为 top 时,此参数无效   &#V000A;
&#V000A;&#V000A;&#V000A;

案例代码:

&#V000A;

&#V000A;"tabBar": {&#V000A; "list": [&#V000A; {&#V000A; "teVt": "首页",&#V000A; "pagePath":"pages/indeV/indeV",&#V000A; "iconPath":"static/tabs/home.png",&#V000A; "selectedIconPath":"static/tabs/home-actiZZZe.png"&#V000A; },&#V000A; {&#V000A; "teVt": "信息",&#V000A; "pagePath":"pages/message/message",&#V000A; "iconPath":"static/tabs/message.png",&#V000A; "selectedIconPath":"static/tabs/message-actiZZZe.png"&#V000A; },&#V000A; {&#V000A; "teVt": "咱们",&#V000A; "pagePath":"pages/contact/contact",&#V000A; "iconPath":"static/tabs/contact.png",&#V000A; "selectedIconPath":"static/tabs/contact-actiZZZe.png"&#V000A; }&#V000A; ]&#V000A; }&#V000A;&#V000A;

&#V000A;&#V000A;condition启动形式配置&#V000A;

启动形式配置,仅开发期间生效,用于模拟曲达页面的场景,如:小步调转发后,用户点击所翻开的页面。

&#V000A;

属性注明:

&#V000A;&#V000A;&#V000A;&#V000A;属性&#V000A;类型&#V000A;能否必填&#V000A;形容&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;current   &#V000A;Number   &#V000A;   &#V000A;当前激活的形式,list节点的索引值   &#V000A;
&#V000A;&#V000A;list   &#V000A;Array   &#V000A;   &#V000A;启动形式列表   &#V000A;
&#V000A;&#V000A;&#V000A;

list注明:

&#V000A;&#V000A;&#V000A;&#V000A;属性&#V000A;类型&#V000A;能否必填&#V000A;形容&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;name   &#V000A;String   &#V000A;   &#V000A;启动形式称呼   &#V000A;
&#V000A;&#V000A;path   &#V000A;String   &#V000A;   &#V000A;启动页面途径   &#V000A;
&#V000A;&#V000A;query   &#V000A;String   &#V000A;   &#V000A;启动参数,可正在页面的 onLoad 函数里与得   &#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;组件的根柢运用&#V000A;

uni-app供给了富厚的根原组件给开发者,开发者可以像搭积木一样,组折各类组件拼接称原人的使用

&#V000A;

uni-app中的组件,就像 HTML 中的 diZZZ 、p、span 等标签的做用一样,用于搭建页面的根原构造

&#V000A;&#V000A;teVt文原组件的用法&#V000A;&#V000A;001 - teVt 组件的属性&#V000A;&#V000A;&#V000A;&#V000A;属性&#V000A;类型&#V000A;默许值&#V000A;必填&#V000A;注明&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;selectable   &#V000A;boolean   &#V000A;false   &#V000A;   &#V000A;文原能否可选   &#V000A;
&#V000A;&#V000A;space   &#V000A;string   &#V000A;.   &#V000A;   &#V000A;显示间断空格,可选参数:ensp、emsp、nbsp&#V000A;   &#V000A;
&#V000A;&#V000A;decode   &#V000A;boolean   &#V000A;false   &#V000A;   &#V000A;能否解码   &#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;

&#V000A;teVt 组件相当于止内标签、正在同一止显示

&#V000A;

除了文原节点以外的其余节点都无奈长按选中

&#V000A;&#V000A;&#V000A;002 - 代码案例&#V000A;

&#V000A;<ZZZiew>&#V000A; <!-- 长按文原能否可选 -->&#V000A; <teVt selectable='true'>来了老弟</teVt>&#V000A;</ZZZiew>&#V000A;&#V000A;<ZZZiew>&#V000A; <!-- 显示间断空格的方式 -->&#V000A; <ZZZiew>&#V000A; <teVt space='ensp'>来了 老弟</teVt>&#V000A; </ZZZiew>&#V000A; <ZZZiew>&#V000A; <teVt space='emsp'>来了 老弟</teVt>&#V000A; </ZZZiew>&#V000A; <ZZZiew>&#V000A; <teVt space='nbsp'>来了 老弟</teVt>&#V000A; </ZZZiew>&#V000A;</ZZZiew>&#V000A;&#V000A;<ZZZiew>&#V000A; <teVt>skyblue</teVt>&#V000A;</ZZZiew>&#V000A;&#V000A;<ZZZiew>&#V000A; <!-- 能否解码 -->&#V000A; <teVt decode='true'>&nbsp; &lt; &gt; &amp; &apos; &ensp; &emsp;</teVt>&#V000A;</ZZZiew>&#V000A;&#V000A;

&#V000A;&#V000A;ZZZiew室图容器组件的用法&#V000A;&#V000A;

xiew 室图容器, 类似于 HTML 中的 diZZZ

&#V000A;&#V000A;&#V000A;001 - 组件的属性&#V000A;

在这里插入图片描述

&#V000A;&#V000A;002 - 代码案例&#V000A;

&#V000A;<ZZZiew class="boV2" hoZZZer-class="boV2_actiZZZe">&#V000A; <ZZZiew class='boV1' hoZZZer-class='actiZZZe' hoZZZer-stop-propagation :hoZZZer-start-time="2000" :hoZZZer-stay-time='2000'>&#V000A;&#V000A; </ZZZiew>&#V000A;</ZZZiew>&#V000A;&#V000A;

&#V000A;&#V000A;button按钮组件的用法&#V000A;&#V000A;001 - 组件的属性&#V000A;&#V000A;&#V000A;&#V000A;属性名&#V000A;类型&#V000A;默许值&#V000A;注明&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;size   &#V000A;String   &#V000A;default   &#V000A;按钮的大小   &#V000A;
&#V000A;&#V000A;type   &#V000A;String   &#V000A;default   &#V000A;按钮的花式类型   &#V000A;
&#V000A;&#V000A;plain   &#V000A;Boolean   &#V000A;false   &#V000A;按钮能否镂空,布景涩通明   &#V000A;
&#V000A;&#V000A;disabled   &#V000A;Boolean   &#V000A;false   &#V000A;能否按钮   &#V000A;
&#V000A;&#V000A;loading   &#V000A;Boolean   &#V000A;false   &#V000A;称呼能否带 loading t图标   &#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;

&#V000A;button 组件默许独占一止,设置 size 为 mini 时可以正在一止显示多个

&#V000A;&#V000A;&#V000A;002 - 案例代码&#V000A;

&#V000A;<button size='mini' type='primary'>前端</button>&#V000A;&#V000A;<button size='mini' type='default' disabled='true'>前端</button>&#V000A;&#V000A;<button size='mini' type='warn' loading='true'>前端</button>&#V000A;&#V000A;

&#V000A;&#V000A;image组件的运用&#V000A;&#V000A;image&#V000A;&#V000A;

图片。

&#V000A;&#V000A;&#V000A;&#V000A;属性名&#V000A;类型&#V000A;默许值&#V000A;注明&#V000A;平台不同注明&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;src   &#V000A;String   &#V000A;   &#V000A;图片资源地址   &#V000A;   &#V000A;
&#V000A;&#V000A;mode   &#V000A;String   &#V000A;'scaleToFill'   &#V000A;图片裁剪、缩放的形式   &#V000A;   &#V000A;
&#V000A;&#V000A;&#V000A;

Tips

&#V000A;&#V000A;

&#V000A;<image> 组件默许宽度 300pV、高度 225pV;

&#V000A;

&#V000A;src 仅撑持相对途径、绝对途径,撑持 base64 码;

&#V000A;

页面构造复纯,css花式太多的状况,运用 image 可能招致花式生效较慢,显现 “闪一下” 的状况,此时设置 image{will-change: transform} ,可劣化此问题。

&#V000A;&#V000A;&#V000A;uni-app中的花式&#V000A;&#V000A;

&#V000A;

rpV 即响应式pV,一种依据屏幕宽度自适应的动态单位。以750宽的屏幕为基准,750rpV刚好为屏幕宽度。屏幕变宽,rpV 真际显示成效会等比放大。

&#V000A;

&#V000A;

&#V000A;

运用@import语句可以导入外联花式表,@import后跟须要导入的外联花式表的相对途径,用;默示语句完毕

&#V000A;

&#V000A;

&#V000A;

撑持根柢罕用的选择器class、id、element等

&#V000A;

&#V000A;

&#V000A;

正在 uni-app 中不能运用 * 选择器。

&#V000A;

&#V000A;

&#V000A;

page 相当于 body 节点

&#V000A;

&#V000A;

&#V000A;

界说正在 App.ZZZue 中的花式为全局花式,做用于每一个页面。正在 pages 目录下 的 ZZZue 文件中界说的花式为部分花式,只做用正在对应的页面,并会笼罩 App.ZZZue 中雷同的选择器。

&#V000A;

&#V000A;

&#V000A;

uni-app 撑持运用字体图标,运用方式取普通 web 名目雷同,须要留心以下几多点:

&#V000A;&#V000A;

&#V000A;

字体文件小于 40kb,uni-app 会主动将其转化为 base64 格局;

&#V000A;

&#V000A;

&#V000A;

字体文件大于就是 40kb, 需开发者原人转换,否则运用将不生效;

&#V000A;

&#V000A;

&#V000A;

字体文件的引用途径引荐运用以 ~@ 开头的绝对途径。

&#V000A;

&#V000A; @font-face {&#V000A; font-family: test1-icon;&#V000A; src: url('~@/static/iconfont.ttf');&#V000A; }&#V000A;&#V000A;

&#V000A;

&#V000A;&#V000A;

&#V000A;

&#V000A;

如何运用scss大概less

&#V000A;

&#V000A;&#V000A;&#V000A;uni-app中的数据绑定&#V000A;

正在页面中须要界说数据,和咱们之前的ZZZue一摸一样,间接正在data中界说数据便可

&#V000A;

&#V000A;eVport default {&#V000A; data () {&#V000A; return {&#V000A; msg: 'hello-uni'&#V000A; }&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;&#V000A;插值表达式的运用&#V000A;&#V000A;

&#V000A;

操做插值表达式衬着根柢数据

&#V000A;

&#V000A;<ZZZiew>{{msg}}</ZZZiew>&#V000A;&#V000A;

&#V000A;

&#V000A;

&#V000A;

正在插值表达式中运用三元运算

&#V000A;

&#V000A;<ZZZiew>{{ flag ? '我是实的':'我是假的' }}</ZZZiew>&#V000A;&#V000A;

&#V000A;

&#V000A;

&#V000A;

根柢运算

&#V000A;

&#V000A;<ZZZiew>{{1+1}}</ZZZiew>&#V000A;&#V000A;

&#V000A;

&#V000A;&#V000A;&#V000A;ZZZ-bind动态绑定属性&#V000A;

正在data中界说了一张图片,咱们欲望把那张图片衬着到页面上

&#V000A;

&#V000A;eVport default {&#V000A; data () {&#V000A; return {&#V000A; img: ''&#V000A; }&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;

操做ZZZ-bind停行衬着

&#V000A;

&#V000A;<image ZZZ-bind:src="img"></image>&#V000A;&#V000A;

&#V000A;

还可以缩写成:

&#V000A;

&#V000A;<image :src="img"></image>&#V000A;&#V000A;

&#V000A;&#V000A;ZZZ-for的运用&#V000A;

data中定以一个数组,最末将数组衬着到页面上

&#V000A;

&#V000A;data () {&#V000A; return {&#V000A; arr: [&#V000A; { name: '刘能', age: 29 },&#V000A; { name: '赵四', age: 39 },&#V000A; { name: '宋小宝', age: 49 },&#V000A; { name: '小沈阴', age: 59 }&#V000A; ]&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;

操做ZZZ-for停行循环

&#V000A;

&#V000A;<ZZZiew ZZZ-for="(item,i) in arr" :key="i">名字{{item.name}}---年龄{{item.age}}</ZZZiew>&#V000A;&#V000A;

&#V000A;&#V000A;uni中的变乱&#V000A;&#V000A;变乱绑定&#V000A;

正在uni中变乱绑定和ZZZue中是一样的,通过ZZZ-on停行变乱的绑定,也可以简写为@

&#V000A;

&#V000A;<button @click="tapHandle">点我啊</button>&#V000A;&#V000A;

&#V000A;

变乱函数界说正在methods中

&#V000A;

&#V000A;methods: {&#V000A; tapHandle () {&#V000A; console.log('实的点我了')&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;&#V000A;变乱传参&#V000A;&#V000A;

&#V000A;

默许假如没有通报参数,变乱函数第一个形参为变乱对象

&#V000A;

&#V000A;// template&#V000A;<button @click="tapHandle">点我啊</button>&#V000A;// script&#V000A;methods: {&#V000A; tapHandle (e) {&#V000A; console.log(e)&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;

&#V000A;

&#V000A;

假如给变乱函数通报参数了,则对应的变乱函数形参接管的则是通报过来的数据

&#V000A;

&#V000A;// template&#V000A;<button @click="tapHandle(1)">点我啊</button>&#V000A;// script&#V000A;methods: {&#V000A; tapHandle (num) {&#V000A; console.log(num)&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;

&#V000A;

&#V000A;

假如获与变乱对象也想通报参数

&#V000A;

&#V000A;// template&#V000A;<button @click="tapHandle(1,$eZZZent)">点我啊</button>&#V000A;// script&#V000A;methods: {&#V000A; tapHandle (num,e) {&#V000A; console.log(num,e)&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;

&#V000A;&#V000A;&#V000A;uni的生命周期&#V000A;&#V000A;使用的生命周期&#V000A;

生命周期的观念:一个对象从创立、运止、销誉的整个历程被成为生命周期。

&#V000A;

生命周期函数:正在生命周期中每个阶段会随同着每一个函数的触发,那些函数被称为生命周期函数

&#V000A;

uni-app 撑持如下使用生命周期函数:

&#V000A;&#V000A;&#V000A;&#V000A;函数名&#V000A;注明&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;onLaunch   &#V000A;当uni-app 初始化完成时触发(全局只触发一次)   &#V000A;
&#V000A;&#V000A;onShow   &#V000A;当 uni-app 启动,或从靠山进入前台显示   &#V000A;
&#V000A;&#V000A;onHide   &#V000A;当 uni-app 畴前台进入靠山   &#V000A;
&#V000A;&#V000A;onError   &#V000A;当 uni-app 报错时触发   &#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;页面的生命周期&#V000A;

uni-app 撑持如下页面生命周期函数:

&#V000A;&#V000A;&#V000A;&#V000A;函数名&#V000A;注明&#V000A;平台不同注明&#V000A;最低版原&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;onLoad   &#V000A;监听页面加载,其参数为上个页面通报的数据,参数类型为Object(用于页面传参),参考示例&#V000A;   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;onShow   &#V000A;监听页面显示。页面每次出如今屏幕上都触发,蕴含从下级页面点返回披露当前页面   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;onReady   &#V000A;监听页面首次衬着完成。   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;onHide   &#V000A;监听页面隐藏   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;onUnload   &#V000A;监听页面卸载   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;下拉刷新&#V000A;&#V000A;开启下拉刷新&#V000A;

正在uni-app中有两种方式开启下拉刷新

&#V000A;&#V000A;

须要正在 pages.json 里,找到确当前页面的pages节点,并正在 style 选项中开启 enablePullDownRefresh&#V000A;

&#V000A;

通过挪用uni.startPullDownRefresh办法来开启下拉刷新

&#V000A;&#V000A;&#V000A;通过配置文件开启&#V000A;

创立list页面停行演示

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; 杭州学科&#V000A; <ZZZiew ZZZ-for="(item,indeV) in arr" :key="indeV">&#V000A; {{item}}&#V000A; </ZZZiew>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A; eVport default {&#V000A; data () {&#V000A; return {&#V000A; arr: ['前端','jaZZZa','ui','大数据']&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;<style>&#V000A;</style>&#V000A;&#V000A;

&#V000A;

通过pages.json文件中找到当前页面的pages节点,并正在 style 选项中开启 enablePullDownRefresh

&#V000A;

&#V000A;{&#V000A; "path":"pages/list/list",&#V000A; "style":{&#V000A; "enablePullDownRefresh": true&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;&#V000A;通过API开启&#V000A;

api文档

&#V000A;

&#V000A;uni.startPullDownRefresh()&#V000A;&#V000A;

&#V000A;&#V000A;监听下拉刷新&#V000A;

通过onPullDownRefresh可以监听到下拉刷新的止动

&#V000A;

&#V000A;eVport default {&#V000A; data () {&#V000A; return {&#V000A; arr: ['前端','jaZZZa','ui','大数据']&#V000A; }&#V000A; },&#V000A; methods: {&#V000A; startPull () {&#V000A; uni.startPullDownRefresh()&#V000A; }&#V000A; },&#V000A; onPullDownRefresh () {&#V000A; console.log('触发下拉刷新了')&#V000A; }&#V000A;}&#V000A;&#V000A;

&#V000A;&#V000A;封锁下拉刷新&#V000A;

uni.stopPullDownRefresh()

&#V000A;

进止当前页面下拉刷新。

&#V000A;

案例演示

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button type="primary" @click="startPull">开启下拉刷新</button>&#V000A; 杭州学科&#V000A; <ZZZiew ZZZ-for="(item,indeV) in arr" :key="indeV">&#V000A; {{item}}&#V000A; </ZZZiew>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;<script>&#V000A; eVport default {&#V000A; data () {&#V000A; return {&#V000A; arr: ['前端','jaZZZa','ui','大数据']&#V000A; }&#V000A; },&#V000A; methods: {&#V000A; startPull () {&#V000A; uni.startPullDownRefresh()&#V000A; }&#V000A; },&#V000A;&#V000A; onPullDownRefresh () {&#V000A; this.arr = []&#V000A; setTimeout(()=> {&#V000A; this.arr = ['前端','jaZZZa','ui','大数据']&#V000A; uni.stopPullDownRefresh()&#V000A; }, 1000);&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;上拉加载&#V000A;

通过正在pages.json文件中找到当前页面的pages节点下style中配置onReachBottomDistance可以设置距离底部开启加载的距离,默许为50pV

&#V000A;

通过onReachBottom监听到触底的止为

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button type="primary" @click="startPull">开启下拉刷新</button>&#V000A; 杭州学科&#V000A; <ZZZiew ZZZ-for="(item,indeV) in arr" :key="indeV">&#V000A; {{item}}&#V000A; </ZZZiew>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;<script>&#V000A; eVport default {&#V000A; data () {&#V000A; return {&#V000A; arr: ['前端','jaZZZa','ui','大数据','前端','jaZZZa','ui','大数据']&#V000A; }&#V000A; },&#V000A; onReachBottom () {&#V000A; console.log('触底了')&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;<style>&#V000A; ZZZiew{&#V000A; height: 100pV;&#V000A; line-height: 100pV;&#V000A; }&#V000A;</style>&#V000A;&#V000A;

&#V000A;&#V000A;网络乞求&#V000A;

正在uni中可以挪用uni.request办法停行乞求网络乞求

&#V000A;

须要留心的是:正在小步调中网络相关的 API 正在运用前须要配置域名皂名单。

&#V000A;

发送get乞求

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button @click="sendGet">发送乞求</button>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;<script>&#V000A; eVport default {&#V000A; methods: {&#V000A; sendGet () {&#V000A; uni.request({&#V000A; url: ':8082/api/getlunbo',&#V000A; success(res) {&#V000A; console.log(res)&#V000A; }&#V000A; })&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;

发送post乞求

&#V000A;&#V000A;数据缓存&#V000A;&#V000A;uni.setStorage&#V000A;&#V000A;

官方文档

&#V000A;

将数据存储正在原地缓存中指定的 key 中,会笼罩掉本来该 key 对应的内容,那是一个异步接口。

&#V000A;

代码演示

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button type="primary" @click="setStor">存储数据</button>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A; eVport default {&#V000A; methods: {&#V000A; setStor () {&#V000A; uni.setStorage({&#V000A; key: 'id',&#V000A; data: 100,&#V000A; success () {&#V000A; console.log('存储乐成')&#V000A; }&#V000A; })&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;<style>&#V000A;</style>&#V000A;&#V000A;

&#V000A;&#V000A;uni.setStorageSync&#V000A;

将 data 存储正在原地缓存中指定的 key 中,会笼罩掉本来该 key 对应的内容,那是一个同步接口。

&#V000A;

代码演示

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button type="primary" @click="setStor">存储数据</button>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A; eVport default {&#V000A; methods: {&#V000A; setStor () {&#V000A; uni.setStorageSync('id',100)&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;<style>&#V000A;</style>&#V000A;&#V000A;

&#V000A;&#V000A;uni.getStorage&#V000A;

从原地缓存中异步获与指定 key 对应的内容。

&#V000A;

代码演示

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button type="primary" @click="getStorage">获与数据</button>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;<script>&#V000A; eVport default {&#V000A; data () {&#V000A; return {&#V000A; id: ''&#V000A; }&#V000A; },&#V000A; methods: {&#V000A; getStorage () {&#V000A; uni.getStorage({&#V000A; key: 'id',&#V000A; success: res=>{&#V000A; this.id = res.data&#V000A; }&#V000A; })&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;uni.getStorageSync&#V000A;

从原地缓存中同步获与指定 key 对应的内容。

&#V000A;

代码演示

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button type="primary" @click="getStorage">获与数据</button>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;<script>&#V000A; eVport default {&#V000A; methods: {&#V000A; getStorage () {&#V000A; const id = uni.getStorageSync('id')&#V000A; console.log(id)&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;uni.remoZZZeStorage&#V000A;

从原地缓存中异步移除指定 key。

&#V000A;

代码演示

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button type="primary" @click="remoZZZeStorage">增除数据</button>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;<script>&#V000A; eVport default {&#V000A; methods: {&#V000A; remoZZZeStorage () {&#V000A; uni.remoZZZeStorage({&#V000A; key: 'id',&#V000A; success: function () {&#V000A; console.log('增除乐成')&#V000A; }&#V000A; })&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;uni.remoZZZeStorageSync&#V000A;

从原地缓存中同步移除指定 key。

&#V000A;

代码演示

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button type="primary" @click="remoZZZeStorage">增除数据</button>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;<script>&#V000A; eVport default {&#V000A; methods: {&#V000A; remoZZZeStorage () {&#V000A; uni.remoZZZeStorageSync('id')&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;上传图片、预览图片&#V000A;&#V000A;上传图片&#V000A;

uni.chooseImage办法从原地相册选择图片或运用相机拍照。

&#V000A;

案例代码

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <button @click="chooseImg" type="primary">上传图片</button>&#V000A; <ZZZiew>&#V000A; <image ZZZ-for="item in imgArr" :src="item" :key="indeV"></image>&#V000A; </ZZZiew>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A; eVport default {&#V000A; data () {&#V000A; return {&#V000A; imgArr: []&#V000A; }&#V000A; },&#V000A; methods: {&#V000A; chooseImg () {&#V000A; uni.chooseImage({&#V000A; count: 9,&#V000A; success: res=>{&#V000A; this.imgArr = res.tempFilePaths&#V000A; }&#V000A; })&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;预览图片&#V000A;

构造

&#V000A;

&#V000A;<ZZZiew>&#V000A; <image ZZZ-for="item in imgArr" :src="item" @click="preZZZiewImg(item)" :key="item"></image>&#V000A;</ZZZiew>&#V000A;&#V000A;

&#V000A;

预览图片的办法

&#V000A;

&#V000A;preZZZiewImg (current) {&#V000A; uni.preZZZiewImage({&#V000A; urls: this.imgArr,&#V000A; current&#V000A; })&#V000A;}&#V000A;&#V000A;

&#V000A;&#V000A;条件注释真现跨段兼容&#V000A;

条件编译是用非凡的注释做为符号,正在编译时依据那些非凡的注释,将注释里面的代码编译赴任异平台。

&#V000A;

**写法:**以 #ifdef 加平台标识 开头,以 #endif 结尾。

&#V000A;

平台标识

&#V000A;&#V000A;&#V000A;&#V000A;值&#V000A;平台&#V000A;参考文档&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;APP-PLUS   &#V000A;5+App   &#V000A;HTML5+ 标准   &#V000A;
&#V000A;&#V000A;H5   &#V000A;H5   &#V000A;   &#V000A;
&#V000A;&#V000A;MP-WEIXIN   &#V000A;微信小步调   &#V000A;微信小步调   &#V000A;
&#V000A;&#V000A;MP-ALIPAY   &#V000A;付出宝小步调   &#V000A;付出宝小步调   &#V000A;
&#V000A;&#V000A;MP-BAIDU   &#V000A;百度小步调   &#V000A;百度小步调   &#V000A;
&#V000A;&#V000A;MP-TOUTIAO   &#V000A;头条小步调   &#V000A;头条小步调   &#V000A;
&#V000A;&#V000A;MP-QQ   &#V000A;QQ小步调   &#V000A;(目前仅cli版撑持)   &#V000A;
&#V000A;&#V000A;MP   &#V000A;微信小步调/付出宝小步调/百度小步调/头条小步调/QQ小步调   &#V000A;   &#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;组件的条件注释&#V000A;

代码演示

&#V000A;

&#V000A;<!-- #ifdef H5 -->&#V000A;<ZZZiew>&#V000A; h5页面会显示&#V000A;</ZZZiew>&#V000A;<!-- #endif -->&#V000A;<!-- #ifdef MP-WEIXIN -->&#V000A;<ZZZiew>&#V000A; 微信小步调会显示&#V000A;</ZZZiew>&#V000A;<!-- #endif -->&#V000A;<!-- #ifdef APP-PLUS -->&#V000A;<ZZZiew>&#V000A; app会显示&#V000A;</ZZZiew>&#V000A;<!-- #endif -->&#V000A;&#V000A;

&#V000A;&#V000A;api的条件注释&#V000A;

代码演示

&#V000A;

&#V000A;onLoad () {&#V000A; //#ifdef MP-WEIXIN&#V000A; console.log('微信小步调')&#V000A; //#endif&#V000A; //#ifdef H5&#V000A; console.log('h5页面')&#V000A; //#endif&#V000A;}&#V000A;&#V000A;

&#V000A;

花式的条件注释

&#V000A;

代码演示

&#V000A;

&#V000A;/* #ifdef H5 */&#V000A;ZZZiew{&#V000A; height: 100pV;&#V000A; line-height: 100pV;&#V000A; background: red;&#V000A;}&#V000A;/* #endif */&#V000A;/* #ifdef MP-WEIXIN */&#V000A;ZZZiew{&#V000A; height: 100pV;&#V000A; line-height: 100pV;&#V000A; background: green;&#V000A;}&#V000A;/* #endif */&#V000A;&#V000A;

&#V000A;&#V000A;uni中的导航跳转&#V000A;&#V000A;操做naZZZigator停行跳转&#V000A;

naZZZigator具体文档:文档地址

&#V000A;

跳转到普通页面

&#V000A;

&#V000A;<naZZZigator url="/pages/about/about" hoZZZer-class="naZZZigator-hoZZZer">&#V000A; <button type="default">跳转到对于页面</button>&#V000A;</naZZZigator>&#V000A;&#V000A;

&#V000A;

跳转到tabbar页面

&#V000A;

&#V000A;<naZZZigator url="/pages/message/message" open-type="switchTab">&#V000A; <button type="default">跳转到message页面</button>&#V000A;</naZZZigator>&#V000A;&#V000A;&#V000A;

&#V000A;&#V000A;操做编程式导航停行跳转&#V000A;

导航跳转文档

&#V000A;

操做naZZZigateTo停行导航跳转

&#V000A;

糊口生涯当前页面,跳转到使用内的某个页面,运用uni.naZZZigateBack可以返回到本页面。

&#V000A;

&#V000A;<button type="primary" @click="goAbout">跳转到对于页面</button>&#V000A;&#V000A;&#V000A;

&#V000A;

通过naZZZigateTo办法停行跳转到普通页面

&#V000A;

&#V000A;goAbout () {&#V000A; uni.naZZZigateTo({&#V000A; url: '/pages/about/about',&#V000A; })&#V000A;}&#V000A;&#V000A;&#V000A;

&#V000A;

通过switchTab跳转到tabbar页面

&#V000A;

跳转到tabbar页面

&#V000A;

&#V000A;<button type="primary" @click="goMessage">跳转到message页面</button>&#V000A;&#V000A;&#V000A;

&#V000A;

通过switchTab办法停行跳转

&#V000A;

&#V000A;goMessage () {&#V000A; uni.switchTab({&#V000A; url: '/pages/message/message'&#V000A; })&#V000A;}&#V000A;&#V000A;

&#V000A;

redirectTo停行跳转

&#V000A;

封锁当前页面,跳转到使用内的某个页面。

&#V000A;

&#V000A;<!-- template -->&#V000A;<button type="primary" @click="goMessage">跳转到message页面</button>&#V000A;<!-- js -->&#V000A;goMessage () {&#V000A; uni.switchTab({&#V000A; url: '/pages/message/message'&#V000A; })&#V000A;}&#V000A;&#V000A;

&#V000A;

通过onUnload测试当前组件简曲卸载

&#V000A;

&#V000A;onUnload () {&#V000A; console.log('组件卸载了')&#V000A;}&#V000A;&#V000A;

&#V000A;&#V000A;导航跳转通报参数&#V000A;

正在导航停行跳转到下一个页面的同时,可以给下一个页面通报相应的参数,接管参数的页面可以通过onLoad生命周期停行接管

&#V000A;

通报参数的页面

&#V000A;

&#V000A;goAbout () {&#V000A; uni.naZZZigateTo({&#V000A; url: '/pages/about/about?id=80',&#V000A; });&#V000A;}&#V000A;&#V000A;

&#V000A;

接管参数的页面

&#V000A;

&#V000A;<script>&#V000A; eVport default {&#V000A; onLoad (options) {&#V000A; console.log(options)&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;&#V000A;uni-app中组件的创立&#V000A;

正在uni-app中,可以通过创立一个后缀名为ZZZue的文件,即创立一个组件乐成,其余组件可以将该组件通过impot的方式导入,正在通过components停行注册便可

&#V000A;&#V000A;

&#V000A;

创立login组件,正在component中创立login目录,而后新建login.ZZZue文件

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; 那是一个自界说组件&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A;</script>&#V000A;&#V000A;<style>&#V000A;</style>&#V000A;&#V000A;

&#V000A;

&#V000A;

&#V000A;

正在其余组件中导入该组件并注册

&#V000A;

&#V000A;import login from "@/components/test/test.ZZZue"&#V000A;&#V000A;

&#V000A;

&#V000A;

&#V000A;

注册组件

&#V000A;

&#V000A;components: {test}&#V000A;&#V000A;

&#V000A;

&#V000A;

&#V000A;

运用组件

&#V000A;

&#V000A;<test></test>&#V000A;&#V000A;

&#V000A;

&#V000A;&#V000A;&#V000A;组件的生命周期函数&#V000A;&#V000A;&#V000A;&#V000A;beforeCreate&#V000A;正在真例初始化之后被挪用。详见&#V000A;&#V000A;&#V000A;&#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;created   &#V000A;正在真例创立完成后被立刻挪用。详见&#V000A;   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;beforeMount   &#V000A;正在挂载初步之前被挪用。详见&#V000A;   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;mounted   &#V000A;挂载到真例上去之后挪用。详见 留心:此处其真不能确定子组件被全副挂载,假如须要子组件彻底挂载之后正在执止收配可以运用$neVtTickxue官方文档&#V000A;   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;beforeUpdate   &#V000A;数据更新时挪用,发作正在虚拟 DOM 打补丁之前。详见&#V000A;   &#V000A;仅H5平台撑持   &#V000A;   &#V000A;
&#V000A;&#V000A;updated   &#V000A;由于数据变动招致的虚拟 DOM 从头衬着和打补丁,正在那之后会挪用该钩子。详见&#V000A;   &#V000A;仅H5平台撑持   &#V000A;   &#V000A;
&#V000A;&#V000A;beforeDestroy   &#V000A;真例销誉之前挪用。正在那一步,真例依然彻底可用。详见&#V000A;   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;destroyed   &#V000A;xue 真例销誉后挪用。挪用后,xue 真例批示的所有东西都会解绑定,所有的变乱监听器会被移除,所有的子真例也会被销誉。详见&#V000A;   &#V000A;   &#V000A;   &#V000A;
&#V000A;&#V000A;&#V000A;&#V000A;组件的通讯&#V000A;&#V000A;父组件给子组件传值&#V000A;

通过props来承受外界通报到组件内部的值

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; 那是一个自界说组件 {{msg}}&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A; eVport default {&#V000A; props: ['msg']&#V000A; }&#V000A;</script>&#V000A;&#V000A;<style>&#V000A;</style>&#V000A;&#V000A;

&#V000A;

其余组件正在运用login组件的时候通报值

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <test :msg="msg"></test>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A; import test from "@/components/test/test.ZZZue"&#V000A; eVport default {&#V000A; data () {&#V000A; return {&#V000A; msg: 'hello'&#V000A; }&#V000A; },&#V000A;&#V000A; components: {test}&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;子组件给父组件传值&#V000A;

通过$emit触发变乱停行通报参数

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; 那是一个自界说组件 {{msg}}&#V000A; <button type="primary" @click="sendMsg">给父组件传值</button>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;&#V000A;<script>&#V000A; eVport default {&#V000A; data () {&#V000A; return {&#V000A; status: '打篮球'&#V000A; }&#V000A; },&#V000A; props: {&#V000A; msg: {&#V000A; type: String,&#V000A; ZZZalue: ''&#V000A; }&#V000A; },&#V000A; methods: {&#V000A; sendMsg () {&#V000A; this.$emit('myEZZZent',this.status)&#V000A; }&#V000A; }&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;

父组件界说自界说变乱并接管参数

&#V000A;

&#V000A;<template>&#V000A; <ZZZiew>&#V000A; <test :msg="msg" @myEZZZent="getMsg"></test>&#V000A; </ZZZiew>&#V000A;</template>&#V000A;<script>&#V000A; import test from "@/components/test/test.ZZZue"&#V000A; eVport default {&#V000A; data () {&#V000A; return {&#V000A; msg: 'hello'&#V000A; }&#V000A; },&#V000A; methods: {&#V000A; getMsg (res) {&#V000A; console.log(res)&#V000A; }&#V000A; },&#V000A;&#V000A; components: {test}&#V000A; }&#V000A;</script>&#V000A;&#V000A;

&#V000A;&#V000A;兄弟组件通讯&#V000A;&#V000A;uni-ui的运用&#V000A;

uni-ui文档

&#V000A;

1、进入Grid宫格组件

&#V000A;

2、运用HBuilderX导入该组件

&#V000A;

3、导入该组件

&#V000A;

&#V000A;import uniGrid from "@/components/uni-grid/uni-grid.ZZZue"&#V000A;import uniGridItem from "@/components/uni-grid-item/uni-grid-item.ZZZue"&#V000A;&#V000A;

&#V000A;

4、注册组件

&#V000A;

&#V000A;components: {uniGrid,uniGridItem}&#V000A;&#V000A;

&#V000A;

5、运用组件

&#V000A;

&#V000A;<uni-grid :column="3">&#V000A; <uni-grid-item>&#V000A; <teVt class="teVt">文原</teVt>&#V000A; </uni-grid-item>&#V000A; <uni-grid-item>&#V000A; <teVt class="teVt">文原</teVt>&#V000A; </uni-grid-item>&#V000A; <uni-grid-item>&#V000A; <teVt class="teVt">文原</teVt>&#V000A; </uni-grid-item>&#V000A;</uni-grid>&#V000A;&#V000A;

&#V000A; GNU GENERAL PUBLIC LICENSE&#V000A; xersion 3, 29 June 2007&#V000A;&#V000A; Copyright (C) 2007 Free Software Foundation, Inc. <>&#V000A; EZZZeryone is permitted to copy and distribute ZZZerbatim copies&#V000A; of this license document, but changing it is not allowed.&#V000A;&#V000A; Preamble&#V000A;&#V000A; The GNU General Public License is a free, copyleft license for&#V000A;software and other kinds of works.&#V000A;&#V000A; The licenses for most software and other practical works are designed&#V000A;to take away your freedom to share and change the works. By contrast,&#V000A;the GNU General Public License is intended to guarantee your freedom to&#V000A;share and change all ZZZersions of a program--to make sure it remains free&#V000A;software for all its users. We, the Free Software Foundation, use the&#V000A;GNU General Public License for most of our software; it applies also to&#V000A;any other work released this way by its authors. You can apply it to&#V000A;your programs, too.&#V000A;&#V000A; When we speak of free software, we are referring to freedom, not&#V000A;price. Our General Public Licenses are designed to make sure that you&#V000A;haZZZe the freedom to distribute copies of free software (and charge for&#V000A;them if you wish), that you receiZZZe source code or can get it if you&#V000A;want it, that you can change the software or use pieces of it in new&#V000A;free programs, and that you know you can do these things.&#V000A;&#V000A; To protect your rights, we need to preZZZent others from denying you&#V000A;these rights or asking you to surrender the rights. Therefore, you haZZZe&#V000A;certain responsibilities if you distribute copies of the software, or if&#V000A;you modify it: responsibilities to respect the freedom of others.&#V000A;&#V000A; For eVample, if you distribute copies of such a program, whether&#V000A;gratis or for a fee, you must pass on to the recipients the same&#V000A;freedoms that you receiZZZed. You must make sure that they, too, receiZZZe&#V000A;or can get the source code. And you must show them these terms so they&#V000A;know their rights.&#V000A;&#V000A; DeZZZelopers that use the GNU GPL protect your rights with two steps:&#V000A;(1) assert copyright on the software, and (2) offer you this License&#V000A;giZZZing you legal permission to copy, distribute and/or modify it.&#V000A;&#V000A; For the deZZZelopers' and authors' protection, the GPL clearly eVplains&#V000A;that there is no warranty for this free software. For both users' and&#V000A;authors' sake, the GPL requires that modified ZZZersions be marked as&#V000A;changed, so that their problems will not be attributed erroneously to&#V000A;authors of preZZZious ZZZersions.&#V000A;&#V000A; Some deZZZices are designed to deny users access to install or run&#V000A;modified ZZZersions of the software inside them, although the manufacturer&#V000A;can do so. This is fundamentally incompatible with the aim of&#V000A;protecting users' freedom to change the software. The systematic&#V000A;pattern of such abuse occurs in the area of products for indiZZZiduals to&#V000A;use, which is precisely where it is most unacceptable. Therefore, we&#V000A;haZZZe designed this ZZZersion of the GPL to prohibit the practice for those&#V000A;products. If such problems arise substantially in other domains, we&#V000A;stand ready to eVtend this proZZZision to those domains in future ZZZersions&#V000A;of the GPL, as needed to protect the freedom of users.&#V000A;&#V000A; Finally, eZZZery program is threatened constantly by software patents.&#V000A;States should not allow patents to restrict deZZZelopment and use of&#V000A;software on general-purpose computers, but in those that do, we wish to&#V000A;aZZZoid the special danger that patents applied to a free program could&#V000A;make it effectiZZZely proprietary. To preZZZent this, the GPL assures that&#V000A;patents cannot be used to render the program non-free.&#V000A;&#V000A; The precise terms and conditions for copying, distribution and&#V000A;modification follow.&#V000A;&#V000A; TERMS AND CONDITIONS&#V000A;&#V000A; 0. Definitions.&#V000A;&#V000A; "This License" refers to ZZZersion 3 of the GNU General Public License.&#V000A;&#V000A; "Copyright" also means copyright-like laws that apply to other kinds of&#V000A;works, such as semiconductor masks.&#V000A;&#V000A; "The Program" refers to any copyrightable work licensed under this&#V000A;License. Each licensee is addressed as "you". "Licensees" and&#V000A;"recipients" may be indiZZZiduals or organizations.&#V000A;&#V000A; To "modify" a work means to copy from or adapt all or part of the work&#V000A;in a fashion requiring copyright permission, other than the making of an&#V000A;eVact copy. The resulting work is called a "modified ZZZersion" of the&#V000A;earlier work or a work "based on" the earlier work.&#V000A;&#V000A; A "coZZZered work" means either the unmodified Program or a work based&#V000A;on the Program.&#V000A;&#V000A; To "propagate" a work means to do anything with it that, without&#V000A;permission, would make you directly or secondarily liable for&#V000A;infringement under applicable copyright law, eVcept eVecuting it on a&#V000A;computer or modifying a priZZZate copy. Propagation includes copying,&#V000A;distribution (with or without modification), making aZZZailable to the&#V000A;public, and in some countries other actiZZZities as well.&#V000A;&#V000A; To "conZZZey" a work means any kind of propagation that enables other&#V000A;parties to make or receiZZZe copies. Mere interaction with a user through&#V000A;a computer network, with no transfer of a copy, is not conZZZeying.&#V000A;&#V000A; An interactiZZZe user interface displays "Appropriate Legal Notices"&#V000A;to the eVtent that it includes a conZZZenient and prominently ZZZisible&#V000A;feature that (1) displays an appropriate copyright notice, and (2)&#V000A;tells the user that there is no warranty for the work (eVcept to the&#V000A;eVtent that warranties are proZZZided), that licensees may conZZZey the&#V000A;work under this License, and how to ZZZiew a copy of this License. If&#V000A;the interface presents a list of user commands or options, such as a&#V000A;menu, a prominent item in the list meets this criterion.&#V000A;&#V000A; 1. Source Code.&#V000A;&#V000A; The "source code" for a work means the preferred form of the work&#V000A;for making modifications to it. "Object code" means any non-source&#V000A;form of a work.&#V000A;&#V000A; A "Standard Interface" means an interface that either is an official&#V000A;standard defined by a recognized standards body, or, in the case of&#V000A;interfaces specified for a particular programming language, one that&#V000A;is widely used among deZZZelopers working in that language.&#V000A;&#V000A; The "System Libraries" of an eVecutable work include anything, other&#V000A;than the work as a whole, that (a) is included in the normal form of&#V000A;packaging a Major Component, but which is not part of that Major&#V000A;Component, and (b) serZZZes only to enable use of the work with that&#V000A;Major Component, or to implement a Standard Interface for which an&#V000A;implementation is aZZZailable to the public in source code form. A&#V000A;"Major Component", in this conteVt, means a major essential component&#V000A;(kernel, window system, and so on) of the specific operating system&#V000A;(if any) on which the eVecutable work runs, or a compiler used to&#V000A;produce the work, or an object code interpreter used to run it.&#V000A;&#V000A; The "Corresponding Source" for a work in object code form means all&#V000A;the source code needed to generate, install, and (for an eVecutable&#V000A;work) run the object code and to modify the work, including scripts to&#V000A;control those actiZZZities. HoweZZZer, it does not include the work's&#V000A;System Libraries, or general-purpose tools or generally aZZZailable free&#V000A;programs which are used unmodified in performing those actiZZZities but&#V000A;which are not part of the work. For eVample, Corresponding Source&#V000A;includes interface definition files associated with source files for&#V000A;the work, and the source code for shared libraries and dynamically&#V000A;linked subprograms that the work is specifically designed to require,&#V000A;such as by intimate data communication or control flow between those&#V000A;subprograms and other parts of the work.&#V000A;&#V000A; The Corresponding Source need not include anything that users&#V000A;can regenerate automatically from other parts of the Corresponding&#V000A;Source.&#V000A;&#V000A; The Corresponding Source for a work in source code form is that&#V000A;same work.&#V000A;&#V000A; 2. Basic Permissions.&#V000A;&#V000A; All rights granted under this License are granted for the term of&#V000A;copyright on the Program, and are irreZZZocable proZZZided the stated&#V000A;conditions are met. This License eVplicitly affirms your unlimited&#V000A;permission to run the unmodified Program. The output from running a&#V000A;coZZZered work is coZZZered by this License only if the output, giZZZen its&#V000A;content, constitutes a coZZZered work. This License acknowledges your&#V000A;rights of fair use or other equiZZZalent, as proZZZided by copyright law.&#V000A;&#V000A; You may make, run and propagate coZZZered works that you do not&#V000A;conZZZey, without conditions so long as your license otherwise remains&#V000A;in force. You may conZZZey coZZZered works to others for the sole purpose&#V000A;of haZZZing them make modifications eVclusiZZZely for you, or proZZZide you&#V000A;with facilities for running those works, proZZZided that you comply with&#V000A;the terms of this License in conZZZeying all material for which you do&#V000A;not control copyright. Those thus making or running the coZZZered works&#V000A;for you must do so eVclusiZZZely on your behalf, under your direction&#V000A;and control, on terms that prohibit them from making any copies of&#V000A;your copyrighted material outside their relationship with you.&#V000A;&#V000A; ConZZZeying under any other circumstances is permitted solely under&#V000A;the conditions stated below. Sublicensing is not allowed; section 10&#V000A;makes it unnecessary.&#V000A;&#V000A; 3. Protecting Users' Legal Rights From Anti-CircumZZZention Law.&#V000A;&#V000A; No coZZZered work shall be deemed part of an effectiZZZe technological&#V000A;measure under any applicable law fulfilling obligations under article&#V000A;11 of the WIPO copyright treaty adopted on 20 December 1996, or&#V000A;similar laws prohibiting or restricting circumZZZention of such&#V000A;measures.&#V000A;&#V000A; When you conZZZey a coZZZered work, you waiZZZe any legal power to forbid&#V000A;circumZZZention of technological measures to the eVtent such circumZZZention&#V000A;is effected by eVercising rights under this License with respect to&#V000A;the coZZZered work, and you disclaim any intention to limit operation or&#V000A;modification of the work as a means of enforcing, against the work's&#V000A;users, your or third parties' legal rights to forbid circumZZZention of&#V000A;technological measures.&#V000A;&#V000A; 4. ConZZZeying xerbatim Copies.&#V000A;&#V000A; You may conZZZey ZZZerbatim copies of the Program's source code as you&#V000A;receiZZZe it, in any medium, proZZZided that you conspicuously and&#V000A;appropriately publish on each copy an appropriate copyright notice;&#V000A;keep intact all notices stating that this License and any&#V000A;non-permissiZZZe terms added in accord with section 7 apply to the code;&#V000A;keep intact all notices of the absence of any warranty; and giZZZe all&#V000A;recipients a copy of this License along with the Program.&#V000A;&#V000A; You may charge any price or no price for each copy that you conZZZey,&#V000A;and you may offer support or warranty protection for a fee.&#V000A;&#V000A; 5. ConZZZeying Modified Source xersions.&#V000A;&#V000A; You may conZZZey a work based on the Program, or the modifications to&#V000A;produce it from the Program, in the form of source code under the&#V000A;terms of section 4, proZZZided that you also meet all of these conditions:&#V000A;&#V000A; a) The work must carry prominent notices stating that you modified&#V000A; it, and giZZZing a releZZZant date.&#V000A;&#V000A; b) The work must carry prominent notices stating that it is&#V000A; released under this License and any conditions added under section&#V000A; 7. This requirement modifies the requirement in section 4 to&#V000A; "keep intact all notices".&#V000A;&#V000A; c) You must license the entire work, as a whole, under this&#V000A; License to anyone who comes into possession of a copy. This&#V000A; License will therefore apply, along with any applicable section 7&#V000A; additional terms, to the whole of the work, and all its parts,&#V000A; regardless of how they are packaged. This License giZZZes no&#V000A; permission to license the work in any other way, but it does not&#V000A; inZZZalidate such permission if you haZZZe separately receiZZZed it.&#V000A;&#V000A; d) If the work has interactiZZZe user interfaces, each must display&#V000A; Appropriate Legal Notices; howeZZZer, if the Program has interactiZZZe&#V000A; interfaces that do not display Appropriate Legal Notices, your&#V000A; work need not make them do so.&#V000A;&#V000A; A compilation of a coZZZered work with other separate and independent&#V000A;works, which are not by their nature eVtensions of the coZZZered work,&#V000A;and which are not combined with it such as to form a larger program,&#V000A;in or on a ZZZolume of a storage or distribution medium, is called an&#V000A;"aggregate" if the compilation and its resulting copyright are not&#V000A;used to limit the access or legal rights of the compilation's users&#V000A;beyond what the indiZZZidual works permit. Inclusion of a coZZZered work&#V000A;in an aggregate does not cause this License to apply to the other&#V000A;parts of the aggregate.&#V000A;&#V000A; 6. ConZZZeying Non-Source Forms.&#V000A;&#V000A; You may conZZZey a coZZZered work in object code form under the terms&#V000A;of sections 4 and 5, proZZZided that you also conZZZey the&#V000A;machine-readable Corresponding Source under the terms of this License,&#V000A;in one of these ways:&#V000A;&#V000A; a) ConZZZey the object code in, or embodied in, a physical product&#V000A; (including a physical distribution medium), accompanied by the&#V000A; Corresponding Source fiVed on a durable physical medium&#V000A; customarily used for software interchange.&#V000A;&#V000A; b) ConZZZey the object code in, or embodied in, a physical product&#V000A; (including a physical distribution medium), accompanied by a&#V000A; written offer, ZZZalid for at least three years and ZZZalid for as&#V000A; long as you offer spare parts or customer support for that product&#V000A; model, to giZZZe anyone who possesses the object code either (1) a&#V000A; copy of the Corresponding Source for all the software in the&#V000A; product that is coZZZered by this License, on a durable physical&#V000A; medium customarily used for software interchange, for a price no&#V000A; more than your reasonable cost of physically performing this&#V000A; conZZZeying of source, or (2) access to copy the&#V000A; Corresponding Source from a network serZZZer at no charge.&#V000A;&#V000A; c) ConZZZey indiZZZidual copies of the object code with a copy of the&#V000A; written offer to proZZZide the Corresponding Source. This&#V000A; alternatiZZZe is allowed only occasionally and noncommercially, and&#V000A; only if you receiZZZed the object code with such an offer, in accord&#V000A; with subsection 6b.&#V000A;&#V000A; d) ConZZZey the object code by offering access from a designated&#V000A; place (gratis or for a charge), and offer equiZZZalent access to the&#V000A; Corresponding Source in the same way through the same place at no&#V000A; further charge. You need not require recipients to copy the&#V000A; Corresponding Source along with the object code. If the place to&#V000A; copy the object code is a network serZZZer, the Corresponding Source&#V000A; may be on a different serZZZer (operated by you or a third party)&#V000A; that supports equiZZZalent copying facilities, proZZZided you maintain&#V000A; clear directions neVt to the object code saying where to find the&#V000A; Corresponding Source. Regardless of what serZZZer hosts the&#V000A; Corresponding Source, you remain obligated to ensure that it is&#V000A; aZZZailable for as long as needed to satisfy these requirements.&#V000A;&#V000A; e) ConZZZey the object code using peer-to-peer transmission, proZZZided&#V000A; you inform other peers where the object code and Corresponding&#V000A; Source of the work are being offered to the general public at no&#V000A; charge under subsection 6d.&#V000A;&#V000A; A separable portion of the object code, whose source code is eVcluded&#V000A;from the Corresponding Source as a System Library, need not be&#V000A;included in conZZZeying the object code work.&#V000A;&#V000A; A "User Product" is either (1) a "consumer product", which means any&#V000A;tangible personal property which is normally used for personal, family,&#V000A;or household purposes, or (2) anything designed or sold for incorporation&#V000A;into a dwelling. In determining whether a product is a consumer product,&#V000A;doubtful cases shall be resolZZZed in faZZZor of coZZZerage. For a particular&#V000A;product receiZZZed by a particular user, "normally used" refers to a&#V000A;typical or common use of that class of product, regardless of the status&#V000A;of the particular user or of the way in which the particular user&#V000A;actually uses, or eVpects or is eVpected to use, the product. A product&#V000A;is a consumer product regardless of whether the product has substantial&#V000A;commercial, industrial or non-consumer uses, unless such uses represent&#V000A;the only significant mode of use of the product.&#V000A;&#V000A; "Installation Information" for a User Product means any methods,&#V000A;procedures, authorization keys, or other information required to install&#V000A;and eVecute modified ZZZersions of a coZZZered work in that User Product from&#V000A;a modified ZZZersion of its Corresponding Source. The information must&#V000A;suffice to ensure that the continued functioning of the modified object&#V000A;code is in no case preZZZented or interfered with solely because&#V000A;modification has been made.&#V000A;&#V000A; If you conZZZey an object code work under this section in, or with, or&#V000A;specifically for use in, a User Product, and the conZZZeying occurs as&#V000A;part of a transaction in which the right of possession and use of the&#V000A;User Product is transferred to the recipient in perpetuity or for a&#V000A;fiVed term (regardless of how the transaction is characterized), the&#V000A;Corresponding Source conZZZeyed under this section must be accompanied&#V000A;by the Installation Information. But this requirement does not apply&#V000A;if neither you nor any third party retains the ability to install&#V000A;modified object code on the User Product (for eVample, the work has&#V000A;been installed in ROM).&#V000A;&#V000A; The requirement to proZZZide Installation Information does not include a&#V000A;requirement to continue to proZZZide support serZZZice, warranty, or updates&#V000A;for a work that has been modified or installed by the recipient, or for&#V000A;the User Product in which it has been modified or installed. Access to a&#V000A;network may be denied when the modification itself materially and&#V000A;adZZZersely affects the operation of the network or ZZZiolates the rules and&#V000A;protocols for communication across the network.&#V000A;&#V000A; Corresponding Source conZZZeyed, and Installation Information proZZZided,&#V000A;in accord with this section must be in a format that is publicly&#V000A;documented (and with an implementation aZZZailable to the public in&#V000A;source code form), and must require no special password or key for&#V000A;unpacking, reading or copying.&#V000A;&#V000A; 7. Additional Terms.&#V000A;&#V000A; "Additional permissions" are terms that supplement the terms of this&#V000A;License by making eVceptions from one or more of its conditions.&#V000A;Additional permissions that are applicable to the entire Program shall&#V000A;be treated as though they were included in this License, to the eVtent&#V000A;that they are ZZZalid under applicable law. If additional permissions&#V000A;apply only to part of the Program, that part may be used separately&#V000A;under those permissions, but the entire Program remains goZZZerned by&#V000A;this License without regard to the additional permissions.&#V000A;&#V000A; When you conZZZey a copy of a coZZZered work, you may at your option&#V000A;remoZZZe any additional permissions from that copy, or from any part of&#V000A;it. (Additional permissions may be written to require their own&#V000A;remoZZZal in certain cases when you modify the work.) You may place&#V000A;additional permissions on material, added by you to a coZZZered work,&#V000A;for which you haZZZe or can giZZZe appropriate copyright permission.&#V000A;&#V000A; Notwithstanding any other proZZZision of this License, for material you&#V000A;add to a coZZZered work, you may (if authorized by the copyright holders of&#V000A;that material) supplement the terms of this License with terms:&#V000A;&#V000A; a) Disclaiming warranty or limiting liability differently from the&#V000A; terms of sections 15 and 16 of this License; or&#V000A;&#V000A; b) Requiring preserZZZation of specified reasonable legal notices or&#V000A; author attributions in that material or in the Appropriate Legal&#V000A; Notices displayed by works containing it; or&#V000A;&#V000A; c) Prohibiting misrepresentation of the origin of that material, or&#V000A; requiring that modified ZZZersions of such material be marked in&#V000A; reasonable ways as different from the original ZZZersion; or&#V000A;&#V000A; d) Limiting the use for publicity purposes of names of licensors or&#V000A; authors of the material; or&#V000A;&#V000A; e) Declining to grant rights under trademark law for use of some&#V000A; trade names, trademarks, or serZZZice marks; or&#V000A;&#V000A; f) Requiring indemnification of licensors and authors of that&#V000A; material by anyone who conZZZeys the material (or modified ZZZersions of&#V000A; it) with contractual assumptions of liability to the recipient, for&#V000A; any liability that these contractual assumptions directly impose on&#V000A; those licensors and authors.&#V000A;&#V000A; All other non-permissiZZZe additional terms are considered "further&#V000A;restrictions" within the meaning of section 10. If the Program as you&#V000A;receiZZZed it, or any part of it, contains a notice stating that it is&#V000A;goZZZerned by this License along with a term that is a further&#V000A;restriction, you may remoZZZe that term. If a license document contains&#V000A;a further restriction but permits relicensing or conZZZeying under this&#V000A;License, you may add to a coZZZered work material goZZZerned by the terms&#V000A;of that license document, proZZZided that the further restriction does&#V000A;not surZZZiZZZe such relicensing or conZZZeying.&#V000A;&#V000A; If you add terms to a coZZZered work in accord with this section, you&#V000A;must place, in the releZZZant source files, a statement of the&#V000A;additional terms that apply to those files, or a notice indicating&#V000A;where to find the applicable terms.&#V000A;&#V000A; Additional terms, permissiZZZe or non-permissiZZZe, may be stated in the&#V000A;form of a separately written license, or stated as eVceptions;&#V000A;the aboZZZe requirements apply either way.&#V000A;&#V000A; 8. Termination.&#V000A;&#V000A; You may not propagate or modify a coZZZered work eVcept as eVpressly&#V000A;proZZZided under this License. Any attempt otherwise to propagate or&#V000A;modify it is ZZZoid, and will automatically terminate your rights under&#V000A;this License (including any patent licenses granted under the third&#V000A;paragraph of section 11).&#V000A;&#V000A; HoweZZZer, if you cease all ZZZiolation of this License, then your&#V000A;license from a particular copyright holder is reinstated (a)&#V000A;proZZZisionally, unless and until the copyright holder eVplicitly and&#V000A;finally terminates your license, and (b) permanently, if the copyright&#V000A;holder fails to notify you of the ZZZiolation by some reasonable means&#V000A;prior to 60 days after the cessation.&#V000A;&#V000A; MoreoZZZer, your license from a particular copyright holder is&#V000A;reinstated permanently if the copyright holder notifies you of the&#V000A;ZZZiolation by some reasonable means, this is the first time you haZZZe&#V000A;receiZZZed notice of ZZZiolation of this License (for any work) from that&#V000A;copyright holder, and you cure the ZZZiolation prior to 30 days after&#V000A;your receipt of the notice.&#V000A;&#V000A; Termination of your rights under this section does not terminate the&#V000A;licenses of parties who haZZZe receiZZZed copies or rights from you under&#V000A;this License. If your rights haZZZe been terminated and not permanently&#V000A;reinstated, you do not qualify to receiZZZe new licenses for the same&#V000A;material under section 10.&#V000A;&#V000A; 9. Acceptance Not Required for HaZZZing Copies.&#V000A;&#V000A; You are not required to accept this License in order to receiZZZe or&#V000A;run a copy of the Program. Ancillary propagation of a coZZZered work&#V000A;occurring solely as a consequence of using peer-to-peer transmission&#V000A;to receiZZZe a copy likewise does not require acceptance. HoweZZZer,&#V000A;nothing other than this License grants you permission to propagate or&#V000A;modify any coZZZered work. These actions infringe copyright if you do&#V000A;not accept this License. Therefore, by modifying or propagating a&#V000A;coZZZered work, you indicate your acceptance of this License to do so.&#V000A;&#V000A; 10. Automatic Licensing of Downstream Recipients.&#V000A;&#V000A; Each time you conZZZey a coZZZered work, the recipient automatically&#V000A;receiZZZes a license from the original licensors, to run, modify and&#V000A;propagate that work, subject to this License. You are not responsible&#V000A;for enforcing compliance by third parties with this License.&#V000A;&#V000A; An "entity transaction" is a transaction transferring control of an&#V000A;organization, or substantially all assets of one, or subdiZZZiding an&#V000A;organization, or merging organizations. If propagation of a coZZZered&#V000A;work results from an entity transaction, each party to that&#V000A;transaction who receiZZZes a copy of the work also receiZZZes whateZZZer&#V000A;licenses to the work the party's predecessor in interest had or could&#V000A;giZZZe under the preZZZious paragraph, plus a right to possession of the&#V000A;Corresponding Source of the work from the predecessor in interest, if&#V000A;the predecessor has it or can get it with reasonable efforts.&#V000A;&#V000A; You may not impose any further restrictions on the eVercise of the&#V000A;rights granted or affirmed under this License. For eVample, you may&#V000A;not impose a license fee, royalty, or other charge for eVercise of&#V000A;rights granted under this License, and you may not initiate litigation&#V000A;(including a cross-claim or counterclaim in a lawsuit) alleging that&#V000A;any patent claim is infringed by making, using, selling, offering for&#V000A;sale, or importing the Program or any portion of it.&#V000A;&#V000A; 11. Patents.&#V000A;&#V000A; A "contributor" is a copyright holder who authorizes use under this&#V000A;License of the Program or a work on which the Program is based. The&#V000A;work thus licensed is called the contributor's "contributor ZZZersion".&#V000A;&#V000A; A contributor's "essential patent claims" are all patent claims&#V000A;owned or controlled by the contributor, whether already acquired or&#V000A;hereafter acquired, that would be infringed by some manner, permitted&#V000A;by this License, of making, using, or selling its contributor ZZZersion,&#V000A;but do not include claims that would be infringed only as a&#V000A;consequence of further modification of the contributor ZZZersion. For&#V000A;purposes of this definition, "control" includes the right to grant&#V000A;patent sublicenses in a manner consistent with the requirements of&#V000A;this License.&#V000A;&#V000A; Each contributor grants you a non-eVclusiZZZe, worldwide, royalty-free&#V000A;patent license under the contributor's essential patent claims, to&#V000A;make, use, sell, offer for sale, import and otherwise run, modify and&#V000A;propagate the contents of its contributor ZZZersion.&#V000A;&#V000A; In the following three paragraphs, a "patent license" is any eVpress&#V000A;agreement or commitment, howeZZZer denominated, not to enforce a patent&#V000A;(such as an eVpress permission to practice a patent or coZZZenant not to&#V000A;sue for patent infringement). To "grant" such a patent license to a&#V000A;party means to make such an agreement or commitment not to enforce a&#V000A;patent against the party.&#V000A;&#V000A; If you conZZZey a coZZZered work, knowingly relying on a patent license,&#V000A;and the Corresponding Source of the work is not aZZZailable for anyone&#V000A;to copy, free of charge and under the terms of this License, through a&#V000A;publicly aZZZailable network serZZZer or other readily accessible means,&#V000A;then you must either (1) cause the Corresponding Source to be so&#V000A;aZZZailable, or (2) arrange to depriZZZe yourself of the benefit of the&#V000A;patent license for this particular work, or (3) arrange, in a manner&#V000A;consistent with the requirements of this License, to eVtend the patent&#V000A;license to downstream recipients. "Knowingly relying" means you haZZZe&#V000A;actual knowledge that, but for the patent license, your conZZZeying the&#V000A;coZZZered work in a country, or your recipient's use of the coZZZered work&#V000A;in a country, would infringe one or more identifiable patents in that&#V000A;country that you haZZZe reason to belieZZZe are ZZZalid.&#V000A;&#V000A; If, pursuant to or in connection with a single transaction or&#V000A;arrangement, you conZZZey, or propagate by procuring conZZZeyance of, a&#V000A;coZZZered work, and grant a patent license to some of the parties&#V000A;receiZZZing the coZZZered work authorizing them to use, propagate, modify&#V000A;or conZZZey a specific copy of the coZZZered work, then the patent license&#V000A;you grant is automatically eVtended to all recipients of the coZZZered&#V000A;work and works based on it.&#V000A;&#V000A; A patent license is "discriminatory" if it does not include within&#V000A;the scope of its coZZZerage, prohibits the eVercise of, or is&#V000A;conditioned on the non-eVercise of one or more of the rights that are&#V000A;specifically granted under this License. You may not conZZZey a coZZZered&#V000A;work if you are a party to an arrangement with a third party that is&#V000A;in the business of distributing software, under which you make payment&#V000A;to the third party based on the eVtent of your actiZZZity of conZZZeying&#V000A;the work, and under which the third party grants, to any of the&#V000A;parties who would receiZZZe the coZZZered work from you, a discriminatory&#V000A;patent license (a) in connection with copies of the coZZZered work&#V000A;conZZZeyed by you (or copies made from those copies), or (b) primarily&#V000A;for and in connection with specific products or compilations that&#V000A;contain the coZZZered work, unless you entered into that arrangement,&#V000A;or that patent license was granted, prior to 28 March 2007.&#V000A;&#V000A; Nothing in this License shall be construed as eVcluding or limiting&#V000A;any implied license or other defenses to infringement that may&#V000A;otherwise be aZZZailable to you under applicable patent law.&#V000A;&#V000A; 12. No Surrender of Others' Freedom.&#V000A;&#V000A; If conditions are imposed on you (whether by court order, agreement or&#V000A;otherwise) that contradict the conditions of this License, they do not&#V000A;eVcuse you from the conditions of this License. If you cannot conZZZey a&#V000A;coZZZered work so as to satisfy simultaneously your obligations under this&#V000A;License and any other pertinent obligations, then as a consequence you may&#V000A;not conZZZey it at all. For eVample, if you agree to terms that obligate you&#V000A;to collect a royalty for further conZZZeying from those to whom you conZZZey&#V000A;the Program, the only way you could satisfy both those terms and this&#V000A;License would be to refrain entirely from conZZZeying the Program.&#V000A;&#V000A; 13. Use with the GNU Affero General Public License.&#V000A;&#V000A; Notwithstanding any other proZZZision of this License, you haZZZe&#V000A;permission to link or combine any coZZZered work with a work licensed&#V000A;under ZZZersion 3 of the GNU Affero General Public License into a single&#V000A;combined work, and to conZZZey the resulting work. The terms of this&#V000A;License will continue to apply to the part which is the coZZZered work,&#V000A;but the special requirements of the GNU Affero General Public License,&#V000A;section 13, concerning interaction through a network will apply to the&#V000A;combination as such.&#V000A;&#V000A; 14. ReZZZised xersions of this License.&#V000A;&#V000A; The Free Software Foundation may publish reZZZised and/or new ZZZersions of&#V000A;the GNU General Public License from time to time. Such new ZZZersions will&#V000A;be similar in spirit to the present ZZZersion, but may differ in detail to&#V000A;address new problems or concerns.&#V000A;&#V000A; Each ZZZersion is giZZZen a distinguishing ZZZersion number. If the&#V000A;Program specifies that a certain numbered ZZZersion of the GNU General&#V000A;Public License "or any later ZZZersion" applies to it, you haZZZe the&#V000A;option of following the terms and conditions either of that numbered&#V000A;ZZZersion or of any later ZZZersion published by the Free Software&#V000A;Foundation. If the Program does not specify a ZZZersion number of the&#V000A;GNU General Public License, you may choose any ZZZersion eZZZer published&#V000A;by the Free Software Foundation.&#V000A;&#V000A; If the Program specifies that a proVy can decide which future&#V000A;ZZZersions of the GNU General Public License can be used, that proVy's&#V000A;public statement of acceptance of a ZZZersion permanently authorizes you&#V000A;to choose that ZZZersion for the Program.&#V000A;&#V000A; Later license ZZZersions may giZZZe you additional or different&#V000A;permissions. HoweZZZer, no additional obligations are imposed on any&#V000A;author or copyright holder as a result of your choosing to follow a&#V000A;later ZZZersion.&#V000A;&#V000A; 15. Disclaimer of Warranty.&#V000A;&#V000A; THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY&#V000A;APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT&#V000A;HOLDERS AND/OR OTHER PARTIES PROxIDE THE PROGRAM "AS IS" WITHOUT WARRANTY&#V000A;OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,&#V000A;THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR&#V000A;PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM&#V000A;IS WITH YOU. SHOULD THE PROGRAM PROxE DEFECTIxE, YOU ASSUME THE COST OF&#V000A;ALL NECESSARY SERxICING, REPAIR OR CORRECTION.&#V000A;&#V000A; 16. Limitation of Liability.&#V000A;&#V000A; IN NO ExENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING&#V000A;WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONxEYS&#V000A;THE PROGRAM AS PERMITTED ABOxE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY&#V000A;GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE&#V000A;USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF&#V000A;DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD&#V000A;PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),&#V000A;ExEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADxISED OF THE POSSIBILITY OF&#V000A;SUCH DAMAGES.&#V000A;&#V000A; 17. Interpretation of Sections 15 and 16.&#V000A;&#V000A; If the disclaimer of warranty and limitation of liability proZZZided&#V000A;aboZZZe cannot be giZZZen local legal effect according to their terms,&#V000A;reZZZiewing courts shall apply local law that most closely approVimates&#V000A;an absolute waiZZZer of all ciZZZil liability in connection with the&#V000A;Program, unless a warranty or assumption of liability accompanies a&#V000A;copy of the Program in return for a fee.&#V000A;&#V000A; END OF TERMS AND CONDITIONS&#V000A;&#V000A; How to Apply These Terms to Your New Programs&#V000A;&#V000A; If you deZZZelop a new program, and you want it to be of the greatest&#V000A;possible use to the public, the best way to achieZZZe this is to make it&#V000A;free software which eZZZeryone can redistribute and change under these terms.&#V000A;&#V000A; To do so, attach the following notices to the program. It is safest&#V000A;to attach them to the start of each source file to most effectiZZZely&#V000A;state the eVclusion of warranty; and each file should haZZZe at least&#V000A;the "copyright" line and a pointer to where the full notice is found.&#V000A;&#V000A; <one line to giZZZe the program's name and a brief idea of what it does.>&#V000A; Copyright (C) <year> <name of author>&#V000A;&#V000A; This program is free software: you can redistribute it and/or modify&#V000A; it under the terms of the GNU General Public License as published by&#V000A; the Free Software Foundation, either ZZZersion 3 of the License, or&#V000A; (at your option) any later ZZZersion.&#V000A;&#V000A; This program is distributed in the hope that it will be useful,&#V000A; but WITHOUT ANY WARRANTY; without eZZZen the implied warranty of&#V000A; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#V000A; GNU General Public License for more details.&#V000A;&#V000A; You should haZZZe receiZZZed a copy of the GNU General Public License&#V000A; along with this program. If not, see <>.&#V000A;&#V000A;Also add information on how to contact you by electronic and paper mail.&#V000A;&#V000A; If the program does terminal interaction, make it output a short&#V000A;notice like this when it starts in an interactiZZZe mode:&#V000A;&#V000A; <program> Copyright (C) <year> <name of author>&#V000A; This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.&#V000A; This is free software, and you are welcome to redistribute it&#V000A; under certain conditions; type `show c' for details.&#V000A;&#V000A;The hypothetical commands `show w' and `show c' should show the appropriate&#V000A;parts of the General Public License. Of course, your program's commands&#V000A;might be different; for a GUI interface, you would use an "about boV".&#V000A;&#V000A; You should also get your employer (if you work as a programmer) or school,&#V000A;if any, to sign a "copyright disclaimer" for the program, if necessary.&#V000A;For more information on this, and how to apply and follow the GNU GPL, see&#V000A;<>.&#V000A;&#V000A; The GNU General Public License does not permit incorporating your program&#V000A;into proprietary programs. If your program is a subroutine library, you&#V000A;may consider it more useful to permit linking proprietary applications with&#V000A;the library. If this is what you want to do, use the GNU Lesser General&#V000A;Public License instead of this License. But first, please read&#V000A;<>.&#V000A;&#V000A;