textarea动态设置它的样式text-align不生效
2019-03-15 18:15:58
微信公开课小程序热门讨论关于「textarea动态设置它的样式text-align不生效」的小程序开发问题
补充:当前Bug的表现(可附上截图)在textarea标签上的textalign样式是根据手动选择对齐方式设置的,选择了对齐方式,但是textarea标签上没有实时变化,而是上一次选择的对齐方式预期表现预期应是我选择了居左text
展开:当前Bug的表现在textarea标签上的textalign样式是根据手动选择对齐方式设置的,选择了对齐方式,但是textarea标签上没有实时变化,而是上一次选择的对齐方式预期表现预期应是我选择了居左textarea里的的文本内容也居左,点击居中textarea文本内容居中复现路径点击居中,textarea文本还是居左,点击居左textarea文本居中了,以此类推,就是textarea的textalign的值永远是上一次点击的值提供一个最简复现Demo<template<divclass=addtextbody:style={height:getHeight+px} <pclass=addtexttitle请输入文字信息在下面输入框:<p <textareavmodel=pagetxtclass=addtextareamaxlength=1autoheightplaceholder=请在此添加文字 :style={background:+backgroundColor[pageb], fontsize:pages+px, color:+color[pagec], textalign:align[pagea], fontstyle:pagei==1?italic:normal, fontweight:pagew==1?bold:normal} <textarea {{align[pagea]}} <divclass=addtexttools <iclass=iconfonticonsize:class={active:num==0}@click=showBox(size,0)<i <iclass=iconfonticoncolor:class={active:num==1}@click=showBox(color,1)<i <iclass=iconfonticonbackground:class={active:num==2}@click=showBox(background,2)<i <iclass=iconfonticonalign:class={active:num==3}@click=showBox(align,3)<i <iclass=iconfonticonweight:class={selected:pagew==1}@click=changeWeight<i <iclass=iconfonticonitalic:class={selected:pagei==1}@click=changeitalic<i <iclass=iconfonticonclear@click=clearstyle=color:00BB9C;<i <div <divclass=addtexttips <divvif=num!=9class=toolsbox :style={background:bgColor,left:num==3?50%:0px,transform:num==3?translate(50%):} <divvif=0==numclass=toolssize <spanvfor=(item,index)infontSize:key=index@click=changeSize(item) <vantagstyle=padding:07px;{{item}}<vantag <span <div <divvif=1==numclass=toolscolor <divvfor=(item,index)incolor:key=index@click=changeColor(index) <span:style={background:+item}<span <div <div <divvif=2==numclass=toolscolor <divvfor=(item,index)inbackgroundColor:key=index@click=changeBackground(index) <span:style={background:+item}<span <div <div <divvif=3==numclass=toolsalign <iclass=iconfonticonaleft@click=alignType(1)<i <iclass=iconfonticonacenter@click=alignType(2)<i <iclass=iconfonticonaright@click=alignType(3)<i <div <div <div <buttonclass=btnaddtype=buttonstyle=margintop:30px;@click=addText插入文字<button<div<template<scriptexportdefault{ name:addtext, data(){ return{ page:{ t:t, b:0, s:14, c:0, a:1, w:, i:, txt: }, num:9, align:[left,left,center,right], color:[333,11cd6e,56abe4,9d55b8,33475f,f4c600,ea8010,eb4f38,ecf0f1,a9b7b7], backgroundColor:[fff,11cd6e,56abe4,9d55b8,33475f,f4c600,ea8010,eb4f38,ecf0f1,a9b7b7], fontSize:[14,16,20,24,32], showColor:true, useLink:false, isEdit:false } }, methods:{ showBox(type,index){ if(thisnum==index){ thisnum=9; return; } thisnum=index; }, changeSize(size){ thispages=size; }, changeColor(index){ thispagec=index }, changeBackground(index){ thispageb=index }, alignType(index){ thispagea=index consolelog(thispagea); }, changeWeight(){ thisnum=9 thispagew=thispagew==1?:1; }, changeitalic(){ thisnum=9 thispagei=thispagei==1?:1; }, addText(){ letthat=this; if(thispagetxt==){ this$showshowToast(文字不能为空); return; } if(thisisEdit){ this$commitgoodsPageeditPage(thispage) }else{ this$commitgoodsPagesetNewPage(thispage); } this$routerback(); }, clear(){ thispaget=t, thispageb=0; thispages=14; thispagec=0, thispagea=1, thispagew=, thispagei= } }, computed:{ getHeight(){ returnthis$apigetSystemInfo()windowHeight }, bgColor(){ if(thisnum==2){ returnF0FFFF }else{ returnfff } }, *getAlign(){ returnthisalign[thispagea1] consolelog(thispagea++thisalign[thispagea1]); returnthisalign[thispagea1] }* }, onLoad(){ if(this$mpquerypage){ thisisEdit=true; thisnum=9; thispage=JSONparse(this$mpquerypage); return; } Objectassign(this$data,this$optionsdata()); } }<script即速小程序:开始就设置为center有效果么:请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https:developersweixinqqcomminiprogramdevdevtoolsminicodehtml)
更多有关「textarea动态设置它的样式text-align不生效」的讨论可以前往微信公开课小程序参与互动哦!
补充:当前Bug的表现(可附上截图)在textarea标签上的textalign样式是根据手动选择对齐方式设置的,选择了对齐方式,但是textarea标签上没有实时变化,而是上一次选择的对齐方式预期表现预期应是我选择了居左text
展开:当前Bug的表现在textarea标签上的textalign样式是根据手动选择对齐方式设置的,选择了对齐方式,但是textarea标签上没有实时变化,而是上一次选择的对齐方式预期表现预期应是我选择了居左textarea里的的文本内容也居左,点击居中textarea文本内容居中复现路径点击居中,textarea文本还是居左,点击居左textarea文本居中了,以此类推,就是textarea的textalign的值永远是上一次点击的值提供一个最简复现Demo<template<divclass=addtextbody:style={height:getHeight+px} <pclass=addtexttitle请输入文字信息在下面输入框:<p <textareavmodel=pagetxtclass=addtextareamaxlength=1autoheightplaceholder=请在此添加文字 :style={background:+backgroundColor[pageb], fontsize:pages+px, color:+color[pagec], textalign:align[pagea], fontstyle:pagei==1?italic:normal, fontweight:pagew==1?bold:normal} <textarea {{align[pagea]}} <divclass=addtexttools <iclass=iconfonticonsize:class={active:num==0}@click=showBox(size,0)<i <iclass=iconfonticoncolor:class={active:num==1}@click=showBox(color,1)<i <iclass=iconfonticonbackground:class={active:num==2}@click=showBox(background,2)<i <iclass=iconfonticonalign:class={active:num==3}@click=showBox(align,3)<i <iclass=iconfonticonweight:class={selected:pagew==1}@click=changeWeight<i <iclass=iconfonticonitalic:class={selected:pagei==1}@click=changeitalic<i <iclass=iconfonticonclear@click=clearstyle=color:00BB9C;<i <div <divclass=addtexttips <divvif=num!=9class=toolsbox :style={background:bgColor,left:num==3?50%:0px,transform:num==3?translate(50%):} <divvif=0==numclass=toolssize <spanvfor=(item,index)infontSize:key=index@click=changeSize(item) <vantagstyle=padding:07px;{{item}}<vantag <span <div <divvif=1==numclass=toolscolor <divvfor=(item,index)incolor:key=index@click=changeColor(index) <span:style={background:+item}<span <div <div <divvif=2==numclass=toolscolor <divvfor=(item,index)inbackgroundColor:key=index@click=changeBackground(index) <span:style={background:+item}<span <div <div <divvif=3==numclass=toolsalign <iclass=iconfonticonaleft@click=alignType(1)<i <iclass=iconfonticonacenter@click=alignType(2)<i <iclass=iconfonticonaright@click=alignType(3)<i <div <div <div <buttonclass=btnaddtype=buttonstyle=margintop:30px;@click=addText插入文字<button<div<template<scriptexportdefault{ name:addtext, data(){ return{ page:{ t:t, b:0, s:14, c:0, a:1, w:, i:, txt: }, num:9, align:[left,left,center,right], color:[333,11cd6e,56abe4,9d55b8,33475f,f4c600,ea8010,eb4f38,ecf0f1,a9b7b7], backgroundColor:[fff,11cd6e,56abe4,9d55b8,33475f,f4c600,ea8010,eb4f38,ecf0f1,a9b7b7], fontSize:[14,16,20,24,32], showColor:true, useLink:false, isEdit:false } }, methods:{ showBox(type,index){ if(thisnum==index){ thisnum=9; return; } thisnum=index; }, changeSize(size){ thispages=size; }, changeColor(index){ thispagec=index }, changeBackground(index){ thispageb=index }, alignType(index){ thispagea=index consolelog(thispagea); }, changeWeight(){ thisnum=9 thispagew=thispagew==1?:1; }, changeitalic(){ thisnum=9 thispagei=thispagei==1?:1; }, addText(){ letthat=this; if(thispagetxt==){ this$showshowToast(文字不能为空); return; } if(thisisEdit){ this$commitgoodsPageeditPage(thispage) }else{ this$commitgoodsPagesetNewPage(thispage); } this$routerback(); }, clear(){ thispaget=t, thispageb=0; thispages=14; thispagec=0, thispagea=1, thispagew=, thispagei= } }, computed:{ getHeight(){ returnthis$apigetSystemInfo()windowHeight }, bgColor(){ if(thisnum==2){ returnF0FFFF }else{ returnfff } }, *getAlign(){ returnthisalign[thispagea1] consolelog(thispagea++thisalign[thispagea1]); returnthisalign[thispagea1] }* }, onLoad(){ if(this$mpquerypage){ thisisEdit=true; thisnum=9; thispage=JSONparse(this$mpquerypage); return; } Objectassign(this$data,this$optionsdata()); } }<script即速小程序:开始就设置为center有效果么:请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https:developersweixinqqcomminiprogramdevdevtoolsminicodehtml)
更多有关「textarea动态设置它的样式text-align不生效」的讨论可以前往微信公开课小程序参与互动哦!
标签:微信公开课,小程序
「textarea动态设置它的样式text-align不生效」热门讨论订阅
方法1:微信扫描微信公开课小程序码即可订阅热门讨论「textarea动态设置它的样式text-align不生效」
方法2:微信搜索微信公开课小程序名称进入,即可订阅热门讨论「textarea动态设置它的样式text-align不生效」
方法3:微信网页访问即速商店,长按识别微信公开课小程序码即可订阅热门讨论「textarea动态设置它的样式text-align不生效」
微信公开课小程序热门讨论「textarea动态设置它的样式text-align不生效」由微信公开课原创摘录于微信小程序商店shop.jisuapp.cn,转载请注明出处。
微信公开课热门讨论「textarea动态设置它的样式text-align不生效」由微信公开课开发者向微信用户提供,并对本服务内容、数据资料及其运营行为等真实性、合法性及有效性承担全部责任。
微信公开课小程序
更新时间:2019-03-15 18:15:58
>
__methodCallerx27;ofundefined
>-404011cloudfunctionexecutionerror
>,请补充选择商家自营-预付卡销售-发行方类目,并在基础信息处申请该类目,通过
>:host在模拟器中显示无效
>:请在小程序服务页面上架正式(非测试)内容或商品后重新提交审核
>.net 微信小程序 上传图片
>'setTimeout'的问题
>‘三朵里熙SPA主题减压空间’为什么搜索关键词‘三朵里‘搜不到
>‘扫普通链接二维码打开小程序‘中设置为体验版,扫码打开是线上版本
>“cloudfunctions**indexjs”gitignore
>“NO ULINK DEVICE FOUND”是怎么回事
>“万马掌上校园”的类目审核
>“上线了”公司开发的微信小程序怎么样?
>“产品是否一定需要条形码”
>