This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-web/index.ts
2021-04-22 14:57:51 +08:00

24 lines
908 B
TypeScript

import axios from 'axios';
import smoothscroll from 'smoothscroll-polyfill';
import { registerDoricJSLoader } from './src/DoricBundleLoader';
import { DoricElement } from './src/DoricElement'
import { NavigationElement } from './src/navigate/NavigationElement'
export * from './src/DoricElement'
export * from './src/navigate/NavigationElement'
export * from './src/DoricPlugin'
export * from './src/DoricRegistry'
export * from './src/DoricDriver'
export * from './src/shader/DoricViewNode'
window.customElements.define('doric-div', DoricElement);
window.customElements.define('doric-navigation', NavigationElement);
smoothscroll.polyfill();
registerDoricJSLoader({
filter: (source) => source.startsWith("assets://"),
request: async (source) => {
const ret = await axios.get(source.replace("assets://", `${window.location.href}/../../doric-demo/bundle/`))
return ret.data
}
})