本文整理匯總了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];
})