本文整理汇总了TypeScript中jb-core.jb.type方法的典型用法代码示例。如果您正苦于以下问题:TypeScript jb.type方法的具体用法?TypeScript jb.type怎么用?TypeScript jb.type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jb-core.jb
的用法示例。
在下文中一共展示了jb.type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
import {jb} from 'jb-core';
import * as jb_ui from 'jb-ui';
jb.type('md-layout-child')
jb.type('md-layout-child-responsive')
var flexOptions = 'none,initial,auto,grow,nogrow,noshrink,0,1,1/2,1/3,2/3,1/4,3/4,1/5,2/5,3/5,4/5,1/10,3/10,7/10,9/10,1/20,3/20,7/20,9/20,11/20,13/20,17/20,19/20';
var offsetOptions = '0,1,1/2,1/3,2/3,1/4,3/4,1/5,2/5,3/5,4/5,1/10,3/10,7/10,9/10,1/20,3/20,7/20,9/20,11/20,13/20,17/20,19/20';
var responsiveSelectors = '<600,>600,600-960,>960,960-1280,>1280,1280-1920,>1920';
jb.component('layout.md',{
type: 'group.style,md-layout',
params: [
{ id: 'layout', as:'string', options: 'row,column' },
{ id: 'align', as:'string', options: 'start,center,end,space-around,space-between,' },
{ id: 'subAlign', as:'string', options: 'start,center,end,' },
{ id: 'margin', type: 'boolean' },
{ id: 'fill', type: 'boolean' },
{ id: 'padding', type: 'boolean' },
{ id: 'wrap', type: 'boolean' },
{ id: 'children', type: 'md-layout-child[]'},
{ id: 'responsive', type: 'md-layout-responsive-layout[]'},
],
impl: function(context) {
var responsiveSelector = context.vars.responsiveSelector || '';
var atts = {}
if (context.params.layout) atts['layout'+responsiveSelector] = context.params.layout;
['margin','fill','padding','wrap'].forEach(p=>{
if(context.params[p])
atts['layout-' + p+ responsiveSelector] = context.params[p];
})