当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Store.path方法代码示例

本文整理汇总了TypeScript中@dojo/framework/stores/Store.Store.path方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Store.path方法的具体用法?TypeScript Store.path怎么用?TypeScript Store.path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@dojo/framework/stores/Store.Store的用法示例。


在下文中一共展示了Store.path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

	it('should use store from properties when passed', () => {
		const store = new Store();
		const storeSpy = spy(store, 'onChange');
		const filterableConfig = [{ id: 'id', title: 'id', filterable: true }];
		const h = harness(() =>
			w(MockMetaMixin(Grid, mockMeta), {
				fetcher: noop,
				updater: noop,
				columnConfig: filterableConfig,
				store,
				height: 500
			})
		);

		h.expect(() =>
			v('div', { key: 'root', classes: [css.root, fixedCss.rootFixed], role: 'table', 'aria-rowcount': null }, [
				v('div', {
					key: 'header',
					scrollLeft: 0,
					classes: [css.header, fixedCss.headerFixed, css.filterGroup],
					row: 'rowgroup'
				}, [
					w(Header, {
						key: 'header-row',
						columnConfig: filterableConfig,
						sorter: noop,
						sort: undefined,
						filter: undefined,
						filterer: noop,
						classes: undefined,
						theme: undefined,
						filterRenderer: undefined,
						sortRenderer: undefined
					})
				]),
				w(Body, {
					key: 'body',
					pages: {},
					totalRows: undefined,
					pageSize: 100,
					columnConfig: filterableConfig,
					pageChange: noop,
					updater: noop,
					fetcher: noop,
					onScroll: noop,
					height: 300,
					classes: undefined,
					theme: undefined
				}),
				v('div', { key: 'footer' }, [
					w(Footer, {
						key: 'footer-row',
						total: undefined,
						page: 1,
						pageSize: 100,
						classes: undefined,
						theme: undefined
					})
				])
			])
		);

		assert.isTrue(storeSpy.calledWithMatch(store.path('_grid')));

		store.apply(
			[
				{
					op: OperationType.REPLACE,
					path: new Pointer('_grid/data/pages/page-1'),
					value: [{ id: 'id' }]
				},
				{
					op: OperationType.REPLACE,
					path: new Pointer('_grid/meta'),
					value: {
						page: 10,
						sort: {
							columnId: 'id',
							direction: 'asc'
						},
						filter: {
							columnId: 'id',
							value: 'id'
						},
						total: 100
					}
				}
			],
			true
		);

		h.expect(() =>
			v('div', { key: 'root', classes: [css.root, fixedCss.rootFixed], role: 'table', 'aria-rowcount': '100' }, [
				v('div', {
					key: 'header',
					scrollLeft: 0,
					classes: [css.header, fixedCss.headerFixed, css.filterGroup],
					row: 'rowgroup'
				}, [
					w(Header, {
//.........这里部分代码省略.........
开发者ID:dojo,项目名称:widgets,代码行数:101,代码来源:Grid.ts


注:本文中的@dojo/framework/stores/Store.Store.path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。