• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript d.v函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中@dojo/widget-core/d.v函数的典型用法代码示例。如果您正苦于以下问题:TypeScript v函数的具体用法?TypeScript v怎么用?TypeScript v使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: render

	render() {
		return v('div', {}, [
			w(Checkbox, {
				label: 'Use Dojo Theme',
				onChange: this.themeChange
			}),
			w(Calendar, {
				month: this._month,
				selectedDate: this._selectedDate,
				theme: this._theme,
				year: this._year,
				onMonthChange: (month: number) => {
					this._month = month;
					this.invalidate();
				},
				onYearChange: (year: number) => {
					this._year = year;
					this.invalidate();
				},
				onDateSelect: (date: Date) => {
					this._selectedDate = date;
					this.invalidate();
				}
			}),
			this._selectedDate ? v('p', [ `Selected Date: ${this._selectedDate.toDateString()}` ]) : null
		]);
	}
开发者ID:dylans,项目名称:widgets,代码行数:27,代码来源:index.ts


示例2: render

	protected render(): DNode {
		const {
			aria = {},
			value,
			showOutput = true,
			max = 100,
			min = 0,
			id
		} = this.properties;

		const percent = Math.round(((value - min) / (max - min)) * 100);
		const output = this._output(value, percent);

		return v('div', { classes: this.theme(css.root) }, [
			v('div', {
				...formatAriaProperties(aria),
				classes: this.theme(css.bar),
				role: 'progressbar',
				'aria-valuemin': `${min}`,
				'aria-valuemax': `${max}`,
				'aria-valuenow': `${value}`,
				'aria-valuetext': output,
				id
			}, this.renderProgress(percent)),
			showOutput ? v('span', { classes: this.theme(css.output) }, [ output ]) : null
		]);
	}
开发者ID:dylans,项目名称:widgets,代码行数:27,代码来源:Progress.ts


示例3: render

	render() {
		const { filter } = this.properties;
		const messages = this.localizeBundle(appBundle);

		return v('ul', { classes: this.theme(css.filters) }, [
			v('li', [
				w(Link, {
					key: 'all',
					classes: this.theme(filter === 'all' ? css.selected : null),
					to: 'view',
					isOutlet: true,
					params: { filter: 'all' }
				}, [ messages.filterAll ]),
				w(Link, {
					key: 'active',
					classes: this.theme(filter === 'active' ? css.selected : null),
					to: 'view',
					isOutlet: true,
					params: { filter: 'active' }
				}, [ messages.filterActive ]),
				w(Link, {
					key: 'completed',
					classes: this.theme(filter === 'completed' ? css.selected : null),
					to: 'view',
					isOutlet: true,
					params: { filter: 'completed' }
				}, [ messages.filterCompleted ])
			])
		]);
	}
开发者ID:dylans,项目名称:examples,代码行数:30,代码来源:TodoFilter.ts


示例4: render

	protected render() {
		const { view } = this.properties;

		return v('ul', {
			classes: this.theme(css.viewChooser)
		}, [
			v('li', [
				w(Link, {
					key: 'list',
					to: 'view',
					isOutlet: true,
					params: { view: 'list' },
					classes: this.theme([ css.list, view === 'list' ? css.active : null ])
				})
			]),
			v('li', [
				w(Link, {
					key: 'card',
					to: 'view',
					isOutlet: true,
					params: { view: 'card' },
					classes: this.theme([ css.cards, view === 'card' ? css.active : null ])
				})
			])
		]);
	}
开发者ID:agubler,项目名称:examples,代码行数:26,代码来源:TodoViewSwitch.ts


示例5: render

	render(): DNode {
		const {
			forId,
			label
		} = this.properties;

		// assign string or object label properites with defaults
		let labelProps: LabelOptions;
		if (typeof label === 'string') {
			labelProps = assign({}, labelDefaults, { content: label });
		}
		else {
			labelProps = assign({}, labelDefaults, label);
		}

		// add label text node to children
		const labelText = v('span', {
			innerHTML: labelProps.content,
			classes: [ this.theme(css.labelText), labelProps.hidden ? baseCss.visuallyHidden : null ]
		});
		if (labelProps.before) {
			this.children.unshift(labelText);
		}
		else {
			this.children.push(labelText);
		}

		return v('label', {
			classes: this.theme(css.root),
			for: forId
		}, this.children);
	}
开发者ID:bitpshr,项目名称:widgets,代码行数:32,代码来源:Label.ts


示例6: function

const expectedToggle = function(widget: Harness<Checkbox>, labels = false) {
	if (labels) {
		return [
			v('div', {
				key: 'offLabel',
				classes: css.offLabel,
				'aria-hidden': null
			}, [ 'off' ]),
			v('div', {
				key: 'toggle',
				classes: css.toggleSwitch
			}),
			v('div', {
				key: 'onLabel',
				classes: css.onLabel,
				'aria-hidden': 'true'
			}, [ 'on' ])
		];
	}

	return [
		null,
		v('div', {
			key: 'toggle',
			classes: css.toggleSwitch
		}),
		null
	];
};
开发者ID:bitpshr,项目名称:widgets,代码行数:29,代码来源:Checkbox.ts


示例7: function

const expectedVDom = function(args: any) {
	const {
		width,
		output,
		value,
		showOutput = true,
		max = 100,
		min = 0,
		id
	} = args;

	return v('div', { classes: css.root }, [
		v('div', {
			classes: css.bar,
			'aria-valuemax': `${max}`,
			'aria-valuemin': `${min}`,
			'aria-valuenow': `${value}`,
			'aria-valuetext': `${output}`,
			role: 'progressbar',
			id
		}, [
			v('div', {
				classes: css.progress,
				styles: {
					width: `${width}%`
				}
			})
		]),
		showOutput ? v('span', { classes: css.output }, [ output ]) : null
	]);
};
开发者ID:dylans,项目名称:widgets,代码行数:31,代码来源:Progress.ts


示例8: render

	protected render() {
		return v('div', { classes: 'home-page' }, [
			w(Banner, {}),
			v('div', { classes: ['container', 'page'] }, [
				v('div', { classes: 'row' }, [w(FeedsContainer, {}), w(TagsContainer, {})])
			])
		]);
	}
开发者ID:agubler,项目名称:examples,代码行数:8,代码来源:Home.ts


示例9: render

	protected render() {
		return v('div', { classes: 'banner' }, [
			v('div', { classes: 'container' }, [
				v('h1', { classes: 'logo-font' }, ['conduit']),
				v('p', ['A place to share your knowledge.'])
			])
		]);
	}
开发者ID:agubler,项目名称:examples,代码行数:8,代码来源:Banner.ts


示例10: renderNativeInput

	protected renderNativeInput(): DNode {
		const {
			disabled,
			end,
			inputProperties = {},
			invalid,
			name,
			readOnly,
			required,
			start,
			step,
			value,
			label,
			theme,
			labelHidden = false,
			labelAfter = false
		} = this.properties;

		const { aria = {} } = inputProperties;

		const children = [
			label ? w(Label, {
				theme,
				disabled,
				invalid,
				readOnly,
				required,
				hidden: labelHidden,
				forId: this._uuid
			}, [ label ]) : null,
			v('input', {
				id: this._uuid,
				...formatAriaProperties(aria),
				'aria-invalid': invalid === true ? 'true' : null,
				'aria-readonly': readOnly === true ? 'true' : null,
				classes: this.theme(css.input),
				disabled,
				invalid,
				key: 'native-input',
				max: end,
				min: start,
				name,
				onblur: this._onNativeBlur,
				onchange: this._onNativeChange,
				onfocus: this._onNativeFocus,
				readOnly,
				required,
				step,
				type: 'time',
				value
			})
		];

		return v('div', {
			key: 'root',
			classes: this.theme(this.getRootClasses())
		}, labelAfter ? children.reverse() : children);
	}
开发者ID:dylans,项目名称:widgets,代码行数:58,代码来源:TimePicker.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript d.w函数代码示例发布时间:2022-05-28
下一篇:
TypeScript createWidgetBase.mixin函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap