Page is a Webview
logical abstraction layer and also the root node for component mounting.
Code import
import { Page } from '@ali/kylin-framework';
Page declaration structure
The API contained in a Page
is declared in Page Interface and provides complete control capabilities of Vue
instances. The following shows a simple Page
usage. initOptions
is responsible for processing additional Vue
configuration options.
import { Page } from '@ali/kylin-framework';
import IndexComponent from './indexComponent.vue';
class IndexPage extends Page {
initOptions() {
return {}
}
render(h) {
return <IndexComponent></IndexComponent>
}
}
new IndexPage('#app');
Page Interface
This section describes the page API, including namespace.
Namespace
ES6
import method:
import { Page } from '@ali/kylin-framework';
API
Currently, Page
provides the following member methods for derivation:
- initOptions
- render
initOptions
function initOptions(): VueOptions
Return value
The return result must be a valid Vue
input parameter. Generally, we do not recommend that you introduce complex configuration to the Page
layer. Involved logic can be maintained in Component
.
render
The function must be a valid render
function of Vue
.
function render(): VNode
Return value
The return result must be a valid VNode
element. Write according to JSX
specifications.