# WebView

这个组件使用了 html 的 iframe 作为内部实现

<template>
  <div class="device-ios">
    <div class="device-inner" v-loading="loading">
      <ba-web-view
        src="https://vant-ui.github.io/vant/v2/mobile.html#/zh-CN/button"
        @load="onLoad"
        :height="500"
      ></ba-web-view>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      loading: true
    };
  },
  methods: {
    onLoad() {
      this.loading = false;
    }
  }
};
</script>
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
显示代码 复制代码

# 属性/事件/参数


# Attributes

参数 说明 类型 可选值 默认值
height webview 高度 Number 0
src webview 加载地址 String

# Events

事件名称 说明 回调参数
load 内容加载完成事件 load

# Slot

名称 说明
更新时间: 2024/7/30 17:14:28