本文整理汇总了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;未经允许,请勿转载。 |
请发表评论