How to use the miniprogram-render.createPage function in miniprogram-render

To help you get started, we’ve selected a few miniprogram-render examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tencent / omi / packages / templates-old / mp-webpack-plugin2 / src / tmpl / page.tmpl.js View on Github external
onLoad(query) {
        const pageName = mp.$$adapter.tool.getPageName(this.route)
        const pageConfig = this.pageConfig = config.pages[pageName] || {}

        if (pageConfig.loadingText) {
            wx.showLoading({
                title: pageConfig.loadingText,
                mask: true,
            })
        }

        const mpRes = mp.createPage(this.route, config)
        this.pageId = mpRes.pageId
        this.window = mpRes.window
        this.document = mpRes.document
        this.query = query

        init(this.window, this.document)

        // 处理跳转页面不存在的情况
        if (config.redirect && config.redirect.notFound) {
            this.window.addEventListener('pagenotfound', evt => {
                dealWithPage(evt, mpRes.window, config.redirect.notFound)
            })
        }

        // 处理跳转受限制页面的情况
        if (config.redirect && config.redirect.accessDenied) {
github Tencent / omi / packages / preact-kbone / build / mp / pages / log / index.js View on Github external
onLoad(query) {
        const pageName = mp.$$adapter.tool.getPageName(this.route)
        const pageConfig = this.pageConfig = config.pages[pageName] || {}

        if (pageConfig.loadingText) {
            wx.showLoading({
                title: pageConfig.loadingText,
                mask: true,
            })
        }

        const mpRes = mp.createPage(this.route, config)
        this.pageId = mpRes.pageId
        this.window = mpRes.window
        this.document = mpRes.document
        this.query = query

        // 写入 page 的方法
        if (typeof this.getTabBar === 'function') this.window.getTabBar = this.getTabBar.bind(this)

        init(this.window, this.document)

        // 处理跳转页面不存在的情况
        if (config.redirect && config.redirect.notFound) {
            this.window.addEventListener('pagenotfound', evt => {
                dealWithPage(evt, mpRes.window, config.redirect.notFound)
            })
        }
github Tencent / omi / packages / omi-kbone / build / mp / pages / log / index.js View on Github external
onLoad(query) {
        const pageName = mp.$$adapter.tool.getPageName(this.route)
        const pageConfig = this.pageConfig = config.pages[pageName] || {}

        if (pageConfig.loadingText) {
            wx.showLoading({
                title: pageConfig.loadingText,
                mask: true,
            })
        }

        const mpRes = mp.createPage(this.route, config)
        this.pageId = mpRes.pageId
        this.window = mpRes.window
        this.document = mpRes.document
        this.query = query

        init(this.window, this.document)

        // 处理跳转页面不存在的情况
        if (config.redirect && config.redirect.notFound) {
            this.window.addEventListener('pagenotfound', evt => {
                dealWithPage(evt, mpRes.window, config.redirect.notFound)
            })
        }

        // 处理跳转受限制页面的情况
        if (config.redirect && config.redirect.accessDenied) {
github Tencent / omi / packages / preact-kbone / build / mp / pages / index / index.js View on Github external
onLoad(query) {
        const pageName = mp.$$adapter.tool.getPageName(this.route)
        const pageConfig = this.pageConfig = config.pages[pageName] || {}

        if (pageConfig.loadingText) {
            wx.showLoading({
                title: pageConfig.loadingText,
                mask: true,
            })
        }

        const mpRes = mp.createPage(this.route, config)
        this.pageId = mpRes.pageId
        this.window = mpRes.window
        this.document = mpRes.document
        this.query = query

        // 写入 page 的方法
        if (typeof this.getTabBar === 'function') this.window.getTabBar = this.getTabBar.bind(this)

        init(this.window, this.document)

        // 处理跳转页面不存在的情况
        if (config.redirect && config.redirect.notFound) {
            this.window.addEventListener('pagenotfound', evt => {
                dealWithPage(evt, mpRes.window, config.redirect.notFound)
            })
        }
github Tencent / omi / packages / omis-kbone / build / mp / pages / index / index.js View on Github external
onLoad(query) {
        const pageName = mp.$$adapter.tool.getPageName(this.route)
        const pageConfig = this.pageConfig = config.pages[pageName] || {}

        if (pageConfig.loadingText) {
            wx.showLoading({
                title: pageConfig.loadingText,
                mask: true,
            })
        }

        const mpRes = mp.createPage(this.route, config)
        this.pageId = mpRes.pageId
        this.window = mpRes.window
        this.document = mpRes.document
        this.query = query

        init(this.window, this.document)

        // 处理跳转页面不存在的情况
        if (config.redirect && config.redirect.notFound) {
            this.window.addEventListener('pagenotfound', evt => {
                dealWithPage(evt, mpRes.window, config.redirect.notFound)
            })
        }

        // 处理跳转受限制页面的情况
        if (config.redirect && config.redirect.accessDenied) {
github Tencent / omi / packages / omi-kbone / build / mp / pages / index / index.js View on Github external
onLoad(query) {
        const pageName = mp.$$adapter.tool.getPageName(this.route)
        const pageConfig = this.pageConfig = config.pages[pageName] || {}

        if (pageConfig.loadingText) {
            wx.showLoading({
                title: pageConfig.loadingText,
                mask: true,
            })
        }

        const mpRes = mp.createPage(this.route, config)
        this.pageId = mpRes.pageId
        this.window = mpRes.window
        this.document = mpRes.document
        this.query = query

        init(this.window, this.document)

        // 处理跳转页面不存在的情况
        if (config.redirect && config.redirect.notFound) {
            this.window.addEventListener('pagenotfound', evt => {
                dealWithPage(evt, mpRes.window, config.redirect.notFound)
            })
        }

        // 处理跳转受限制页面的情况
        if (config.redirect && config.redirect.accessDenied) {
github wechat-miniprogram / kbone / packages / mp-webpack-plugin / src / tmpl / page.tmpl.js View on Github external
onLoad(query) {
        const pageName = mp.$$adapter.tool.getPageName(this.route)
        const pageConfig = this.pageConfig = config.pages[pageName] || {}

        if (pageConfig.loadingText) {
            wx.showLoading({
                title: pageConfig.loadingText,
                mask: true,
            })
        }

        const mpRes = mp.createPage(this.route, config)
        this.pageId = mpRes.pageId
        this.window = mpRes.window
        this.document = mpRes.document
        this.query = query

        // 写入 page 的方法
        if (typeof this.getTabBar === 'function') this.window.getTabBar = this.getTabBar.bind(this)

        // 处理跳转页面不存在的情况
        if (config.redirect && config.redirect.notFound) {
            this.window.addEventListener('pagenotfound', evt => {
                dealWithPage(evt, mpRes.window, config.redirect.notFound)
            })
        }

        // 处理跳转受限制页面的情况

miniprogram-render

web's adapter for miniprogram

MIT
Latest version published 3 months ago

Package Health Score

74 / 100
Full package analysis