Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 国产精品久久久久久久y,日韩精品久久久毛片一区二区,在线观看视频一区

          整合營銷服務商

          電腦端+手機端+微信端=數據同步管理

          免費咨詢熱線:

          Ionic開發(十四-2 配置文件plugin.xm

          Ionic開發(十四-2 配置文件plugin.xml詳解)

          onic開發中,cordova自定義插件之配置文件plugin.xml詳解

          <?xml version="1.0" encoding="UTF-8"?>

          <plugin

          xmlns="http://apache.org/cordova/ns/plugins/1.0"id="cordova-plugin-device"version="0.0.1">

          <engines>

          <enginename="cordova-android"version="=1.8.0"/>

          </engines>

          <name>Device</name>

          <description>Cordova Device Plugin</description>

          <license>Apache 2.0</license>

          <keywords>cordova,device</keywords>

          <js-modulesrc="www/device.js"name="device">

          <clobberstarget="device"/>

          </js-module>

          <platformname="ios">

          <config-filetarget="config.xml"parent="/*">

          <featurename="Device">

          <paramname="ios-package"value="CDVDevice"/>

          </feature>

          </config-file>

          <header-filesrc="src/ios/CDVDevice.h"/>

          <source-filesrc="src/ios/CDVDevice.m"/>

          </platform>

          </plugin>

          詳細解讀:

          1、plugin(頂級節點,最外層)

          <?xml version="1.0" encoding="UTF-8"?>

          <plugin

          xmlns="http://apache.org/cordova/ns/plugins/1.0"

          xmlns:android="http://schemas.android.com/apk/res/android"id="my-plugin-id"version="1.0.2">

          Attributes

          xmlns:插件命名空間,如果包括其他命名空間的xml文件,例如android的AndroidManifest.xml 也需要添加到plugin的頭標簽中。

          id:npm風格的插件標識符

          version:插件版本號(例:0.0.1)

          2、engine/engines (二級節點)

          需要注意cordova6.1.0以上版本,推薦在package.json中指定插件依賴的platform、plugin和CLI 。

          <engines>

          <enginename="cordova-android"version="=1.8.0"/>

          </engines>

          <engines>

          <enginename="cordova"version="&gt;=1.7.0"/>

          <enginename="cordova-android"version="&gt;=1.8.0"/>

          <enginename="cordova-ios"version="&gt;=1.7.1"/>

          </engines>

          默認支持的引擎如下:

          cordova

          cordova-plugman

          cordova-android

          cordova-ios

          cordova-blackberry10

          cordova-wp8

          cordova-windows

          cordova-osx

          windows-os

          android-sdk (returns the highest Android api level installed)

          windows-sdk (returns the native windows SDK version)

          apple-xcode (returns the xcode version)

          apple-ios (returns the highest iOS version installed)

          apple-osx (returns the OSX version)

          blackberry-ndk (returns the native blackberry SDK version)

          &gt;=1.7.1

          是模糊指定版本,>=1.7.1

          3、name(二級節點)

          <name>Foo</name>

          指定插件名稱

          4、description(二級節點)

          <description>Foo plugin description</description>

          插件描述信息

          5、author(二級節點)

          <author>Foo plugin author</author>

          插件作者

          6、keywords(二級節點)

          <keywords>foo,bar</keywords>

          插件關鍵字

          7、license(二級節點)

          <license>Apache 2.0 License</license>

          插件授權描述

          8、asset(二級節點)

          <!-- a single file, to be copied in the root directory -->

          <assetsrc="www/foo.js"target="foo.js"/>

          <!-- a directory, also to be copied in the root directory -->

          <assetsrc="www/foo"target="foo"/>

          列出將被復制到www下的文件夾和文件等資源,

          src是插件里相對plugin.xml的路徑,必須存在,否則安裝插件的時候會報錯失敗;

          target是app里相對www文件夾的路徑,如果已經存在,那么安裝插件的時候會報錯失敗。

          可以設定多級子文件夾,同時可以重命名

          9、js-module(二級節點)(platform下子節點)

          <js-modulesrc="socket.js"name="Socket"></js-module>

          src是插件里相對plugin.xml的js文件路徑,必須存在,否則CLI安裝插件的時候會報錯失敗;

          name可以自行設定module的名稱,通常是插件的id。

          一個<js-module>對應一個javascript文件,避免用戶不得不為每一個文件引入<script>標簽,會自動添加。

          <js-module>可以嵌套在指定的<platform>中,用于指定平臺下的js 模塊聲明。

          例子分析:安裝插件的時候,socket.js 會被拷貝到 /www/plugins/my-plugin-id/socket.js ,同時在/www/cordova_plugins.js 中添加條目,應用啟動加載的時候,cordova.js 通過XHR讀取每個文件并注入<script>到html中。

          Also for this example, with a plugin id of chrome-socket, the module name will be chrome-socket.Socket.

          參考:http://cordova.apache.org/docs/en/latest/plugin_ref/spec.html

          下實例中,通過切換不同開關 checked 顯示不同的值,true 為打開,false 為關閉。

          HTML 代碼

          <ion-header-bar class="bar-positive">
           <h1 class="title">開關切換</h1></ion-header-bar>
           <ion-content>
           <div class="list">
           <div class="item item-divider">
           Settings </div>
           <ion-toggle ng-repeat="item in settingsList"
           ng-model="item.checked"
           ng-checked="item.checked">
           {{ item.text }} </ion-toggle>
           <div class="item">
           <!-- 使用 pre 標簽展示效果更美觀 -->
           <div ng-bind="settingsList | json"></div>
           </div>
           <div class="item item-divider">
           Notifications </div>
           <ion-toggle ng-model="pushNotification.checked"
           ng-change="pushNotificationChange()">
           Push Notifications </ion-toggle>
           <div class="item">
           <!-- 使用 pre 標簽展示效果更美觀 -->
           <div ng-bind="pushNotification | json"></div>
           </div>
           <ion-toggle toggle-class="toggle-assertive"
           ng-model="emailNotification"
           ng-true-value="'Subscribed'"
           ng-false-value="'Unubscribed'">
           Newsletter </ion-toggle>
           <div class="item">
           <!-- 使用 pre 標簽展示效果更美觀 -->
           <div ng-bind="emailNotification | json"></div>
           </div>
           </div>
           </ion-content>

          由于pre標簽沖突,實例中的 pre 已替換為 div標簽,具體可以在"嘗試一下"中查看。

          JavaScript 代碼

          angular.module('ionicApp', ['ionic']).controller('MainCtrl', function($scope) {
           $scope.settingsList=[
           { text: "Wireless", checked: true },
           { text: "GPS", checked: false },
           { text: "Bluetooth", checked: false }
           ];
           $scope.pushNotificationChange=function() {
           console.log('Push Notification Change', $scope.pushNotification.checked);
           };
           $scope.pushNotification={ checked: true };
           $scope.emailNotification='Subscribed';
           });

          css 代碼:

          body {
           cursor: url('http://www.runoob.com/try/demo_source/finger.png'), auto;}

          效果如下所示:

          ionic 單選框操作

          ionic 手勢事件

          話不說直接上干貨



          開發語言

          Flutter Dart

          Ionic HTML,CSS,JavaScript(支持VUE React Angular)

          運行環境

          Flutter Flutter特有的引擎

          Ionic Web 瀏覽器(或者WebView)

          硬件功能訪問

          Flutter Flutter 本地接口插件庫

          Ionic Cordova 或者 Capacitor(比較成熟的插件庫)

          離線訪問

          Flutter 支持

          Ionic 支持

          App流暢度

          Flutter 和原生沒差別

          Ionic 不如原生,但是感受不出來明顯的差距

          瀏覽器端表現

          Flutter 有限支持

          Ionic 天生適合瀏覽器訪問

          可實現應用

          Flutter 手機APP,電腦桌面軟件,瀏覽器應用

          Ionic 手機APP,電腦桌面軟件,瀏覽器應用,PWA


          再來一個小總結:

          Ionic 因為使用的是html css js等web開發的技術,所以上手容易生態繁榮,但是也因為如此,ionic開發的APP的性能,距離原生還有一段差距


          主站蜘蛛池模板: 99国产精品欧美一区二区三区 | 岛国精品一区免费视频在线观看| 国产精品特级毛片一区二区三区| 伊人色综合一区二区三区| 区三区激情福利综合中文字幕在线一区 | 日本免费电影一区二区| 文中字幕一区二区三区视频播放 | 日韩精品一区二区三区视频| 视频一区二区三区人妻系列| 国产一区二区三区手机在线观看| 麻豆国产在线不卡一区二区| 国产精品一区12p| 久久精品道一区二区三区| 一区二区传媒有限公司| 亚洲AⅤ无码一区二区三区在线 | 一本一道波多野结衣AV一区| 日韩精品一区二三区中文| 国产亚洲3p无码一区二区| 亚洲一区电影在线观看| 能在线观看的一区二区三区| 国产亚洲一区二区手机在线观看| 中日韩精品无码一区二区三区| 视频一区视频二区在线观看| 久久久久久综合一区中文字幕| 精品国产一区二区三区| 中文字幕一区二区三区免费视频| 中文字幕视频一区| 国产99精品一区二区三区免费| 少妇激情一区二区三区视频| 国产成人精品亚洲一区| 日韩精品一区二区亚洲AV观看| 精品国产一区在线观看| 久久精品国产免费一区| 一区二区三区视频| 亚洲色精品aⅴ一区区三区| 日韩免费视频一区| 亚洲国产一区在线| 国产精品免费大片一区二区| 色窝窝免费一区二区三区 | 色欲综合一区二区三区| 日韩一区二区三区视频久久|