當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript d.w函數代碼示例

本文整理匯總了TypeScript中@dojo/widget-core/d.w函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript w函數的具體用法?TypeScript w怎麽用?TypeScript w使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了w函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: render

	// prettier-ignore
	protected render() {
		const { errors, email, password, username, inProgress = false } = this.properties;

		return v('div', { classes: 'auth-page' }, [
			v('div', { classes: ['container', 'page'] }, [
				v('div', { classes: 'row' }, [
					v('div', { classes: ['col-md-6', 'offset-md-3', 'col-xs-12'] }, [
						v('h1', { classes: 'text-xs-center' }, ['Sign Up']),
						v('p', { classes: 'text-xs-center' }, [w(Link, { to: 'login' }, ['Have an account?'])]),
						errors ? w(ErrorList, { errors }) : null,
						v('form', { onsubmit: this._onRegister }, [
							v('fieldset', [
								v('fieldset', { classes: 'form-group' }, [
									createInputNode(username, 'Username', this._onUsernameInput)
								]),
								v('fieldset', { classes: 'form-group' }, [
									createInputNode(email, 'Email', this._onEmailInput)
								]),
								v('fieldset', { classes: 'form-group' }, [
									createInputNode(password, 'Password', this._onPasswordInput)
								]),
								v('button', {
									classes: ['btn btn-lg', 'btn-primary', 'pull-xs-right'],
									disabled: inProgress,
									type: 'submit'
								}, ['Sign Up'])
							])
						])
					])
				])
			])
		]);
	}
開發者ID:agubler,項目名稱:examples,代碼行數:34,代碼來源:Register.ts

示例2: 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

示例3: render

	render() {
		return v('div', [
			v('h1', {}, ['Label Examples']),
			v('h3', {}, ['Label assigned as string without extra options']),
			v('div', { id: 'example-1'}, [
				w(Label, {
					label: 'Type something'
				}, [
					v('input', {
						type: 'text',
						placeholder: '...'
					})
				])
			]),
			v('h3', {}, ['Hidden label after the input']),
			v('div', { id: 'example-2'}, [
				w(Label, {
					label: {
						content: 'Can\'t read me!',
						hidden: true,
						before: false
					}
				}, [
					v('input', {
						type: 'text',
						placeholder: 'Type something'
					})
				])
			])
		]);
	}
開發者ID:bitpshr,項目名稱:widgets,代碼行數:31,代碼來源:index.ts

示例4: 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

示例5: render

	protected render() {
		return w(Menu, { onSelected: this._onSelected }, [
			w(MenuItem, { key: 'a', title: 'Menu Item A' }),
			w(MenuItem, { key: 'b', title: 'Menu Item B', selected: true }),
			w(MenuItem, { key: 'c', title: 'Menu Item C' })
		]);
	}
開發者ID:agubler,項目名稱:examples,代碼行數:7,代碼來源:main.ts

示例6: 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

示例7: render

	protected render() {
		const { article, article: { author, favorited } } = this.properties;

		let buttonClasses = ['btn', 'btn-outline-primary', 'btn-sm', 'pull-xs-right'];
		if (favorited) {
			buttonClasses = ['btn', 'btn-primary', 'btn-sm', 'pull-xs-right'];
		}

		return v('div', { classes: 'article-preview' }, [
			v('div', { classes: 'article-meta' }, [
				w(Link, { to: 'user', params: { username: author.username } }, [v('img', { src: author.image })]),
				v('div', { classes: 'info' }, [
					w(Link, { classes: 'author', to: 'user', params: { username: author.username } }, [
						author.username
					]),
					v('span', { classes: 'date' }, [new Date(article.createdAt).toDateString()])
				]),
				v('button', { onclick: this._onFav, classes: buttonClasses }, [
					v('i', { classes: 'ion-heart' }),
					v('span', [` ${article.favoritesCount}`])
				]),
				w(Link, { classes: 'preview-link', to: 'article', params: { slug: article.slug } }, [
					v('h1', [article.title]),
					v('p', [article.description]),
					v('span', ['Read more...'])
				])
			])
		]);
	}
開發者ID:agubler,項目名稱:examples,代碼行數:29,代碼來源:ArticlePreview.ts

示例8: function

		getChildrenNodes: function (this: Widget<MainSectionProperties>): DNode[] {
			const { properties: { activeFilter, todos, allCompleted: checked } } = this;

			return [
				w('checkbox', { checked, onChange: todoToggleAll, classes: [ 'toggle-all' ]}),
				w('todo-list', { todos, activeFilter })
			];
		}
開發者ID:Tomdye,項目名稱:examples,代碼行數:8,代碼來源:createMainSection.ts

示例9: 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

示例10: _unauthenticatedMenu

	private _unauthenticatedMenu(): DNode[] {
		const { route } = this.properties;
		return [
			v('li', { key: 'sign-in', classes: 'nav-item' }, [
				w(Link, { classes: ['nav-link', route === 'login' ? 'active' : null], to: 'login' }, ['Sign In'])
			]),
			v('li', { key: 'sign-up', classes: 'nav-item' }, [
				w(Link, { classes: ['nav-link', route === 'register' ? 'active' : null], to: 'register' }, ['Sign Up'])
			])
		];
	}
開發者ID:dylans,項目名稱:examples,代碼行數:11,代碼來源:Header.ts


注:本文中的@dojo/widget-core/d.w函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。