1、Es6的新语法有哪些?
1、新增块级作用域,let const
2、for of 和for in
3、解构赋值:变量替换对象里的值
4、展开运算符:…用法
5、模板字符串,用${``},可在其中加入变量。反引号
6、箭头函数:
2、有几种方式实现元素的居中对齐?
1、flex布局(弹性盒):
父:
display: flex;
justify-content: center;
2、transform定位
子绝父相
父:
position: relative;
子:
left: 50%;top: 50%;transform: translate(-50%, -50%);position: absolute;
3、小程序如何实现注册全局变量
4、小程序是如何进行组件的传值
父传子:
1、json中注册
{"component": true,"usingComponents": {"componentB": "../child2/child2"}
}
2、标签内传值
<view>我是组件A</view>
<view><view>子组件内容:</view><componentB paramAtoB='我是A向B中传入的参数'/>
</view>
3、引用放到properties
Component({behaviors: [],properties: {paramAtoB:String},data: {}, // 私有数据,可用于模版渲染// 生命周期函数,可以为函数,或一个在methods段中定义的方法名attached: function () { },moved: function () { },detached: function () { },methods: {}})
子传父:
1、子组件json和js必须是组件
{"component": true,"usingComponents": {}
}
Component({})
2、子组件中定义一个方法
onMyEvent:function(e){this.setData({paramBtoA: e.detail.paramBtoA})}
3、父组件拿到方法
<componentB bind:myevent="onMyEvent"/>
5、Vue2.0和Vue3.0的区别在哪里
6、关于跨域,如何解释
7、