install-apk.uvue 906 字节
Newer Older
taohebin@dcloud.io's avatar
taohebin@dcloud.io 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<template>
  <!-- #ifdef APP -->
  <scroll-view style="flex: 1">
  <!-- #endif -->
    <view>
      <page-head :title="title"></page-head>
      <view class="uni-common-mt">
        <view class="uni-padding-wrap">
          <view class="uni-btn-v">
            <button type="primary" @tap="installApk">
              installApk
            </button>
          </view>
        </view>
      </view>
    </view>
  <!-- #ifdef APP -->
  </scroll-view>
  <!-- #endif -->
</template>
<script>
  export default {
    data() {
      return {
        title: 'installApk'
      }
    },
    onUnload: function () {
    },
    methods: {
      installApk: function () {
        uni.installApk({
          filePath: "/static/test-apk/test.apk",
          complete(res : any) {
            console.log(res);
          }
        })
      },
    }
  }
</script>
<style>
</style>