fix(GOV-009): 消除前端运行时模板警告
This commit is contained in:
@@ -21,5 +21,6 @@ describe('应用外壳', () => {
|
|||||||
expect(wrapper.get('header').attributes('aria-label')).toBe('应用导航');
|
expect(wrapper.get('header').attributes('aria-label')).toBe('应用导航');
|
||||||
expect(wrapper.get('main').attributes('id')).toBe('main-content');
|
expect(wrapper.get('main').attributes('id')).toBe('main-content');
|
||||||
expect(wrapper.text()).toContain('A 股市场分析工具');
|
expect(wrapper.text()).toContain('A 股市场分析工具');
|
||||||
|
expect(wrapper.text()).toContain('工程基线已就绪');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,13 +4,15 @@ import {
|
|||||||
type RouterHistory,
|
type RouterHistory,
|
||||||
type RouteRecordRaw,
|
type RouteRecordRaw,
|
||||||
} from 'vue-router';
|
} from 'vue-router';
|
||||||
|
import { h } from 'vue';
|
||||||
|
|
||||||
const routes: RouteRecordRaw[] = [
|
const routes: RouteRecordRaw[] = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
name: 'home',
|
name: 'home',
|
||||||
component: {
|
component: {
|
||||||
template: '<section aria-label="应用就绪"><p>工程基线已就绪</p></section>',
|
// 工程基线不引入运行时模板编译器;业务首页落地前用渲染函数提供可观测占位内容。
|
||||||
|
render: () => h('section', { 'aria-label': '应用就绪' }, [h('p', '工程基线已就绪')]),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ test('应用外壳在桌面和移动视口均可正常呈现', async ({ page })
|
|||||||
const runtimeErrors: string[] = [];
|
const runtimeErrors: string[] = [];
|
||||||
|
|
||||||
page.on('console', (message) => {
|
page.on('console', (message) => {
|
||||||
if (message.type() === 'error') runtimeErrors.push(message.text());
|
if (message.type() === 'error' || message.type() === 'warning') {
|
||||||
|
runtimeErrors.push(message.text());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
page.on('pageerror', (error) => runtimeErrors.push(error.message));
|
page.on('pageerror', (error) => runtimeErrors.push(error.message));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user