Skip to content

WebView

第1步:package.json引入库

点击查看源码
js
"@extscreen/es-component": "3.0.1",

第2步:main-native.js中注册组件

点击查看源码
js
import {ESComponent} from "@extscreen/es-component";
Vue.use(ESComponent)

第3步:ESPage中使用

点击查看源码
vue

<template>
  <div class="es-sdk-root-css">
    <es-web-view
        ref="web_view"
        class="index_root_x5web_view_content_css"/>
    <title class="es-sdk-content-title-css" :text="this.$options.name"/>
    <div class="es-sdk-content-divider-css"/>
  </div>
</template>

<script>

import {ESPage} from "@extscreen/es-core";

export default {
  name: 'WebView',
  mixins: [ESPage],
  data() {
    return {};
  },
  mounted() {
    this.$refs.web_view.loadUrl("http://extscreen.com");
  },
};
</script>

<style scoped>
.index_root_x5web_view_content_css {
  width: 1920px;
  height: 1080px;
  position: absolute;
}

</style>