12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211 |
- <template>
- <view>
- <template name="wxParseVideo">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <video :class="item.classStr + ' wxParse-' + item.tag + '-video'" :src="item.attr.src"></video>
- </view>
- </template>
- <template name="wxParseImg">
- <image
- :class="item.classStr + ' wxParse-' + item.tag"
- :data-from="item.from"
- :data-src="item.attr.src"
- :data-idx="item.imgIndex"
- :src="item.attr.src"
- mode="aspectFit"
- @load="wxParseImgLoad"
- @tap="wxParseImgTap"
- :style="'width:' + item.width + 'px;height:' + item.height + 'px;' + item.attr.style"
- />
- </template>
- <!-- template对应的原始代码,为保证正常显示,已对其进行隐藏。 -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- <template name="wxParse">
- <block :wx:for="wxParseData" wx:key="key">
- <!-- <template is="wxParse0" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </template>
- <template name="wxParse0">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse1" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse1" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-c="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse1" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tag == 'table'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse1" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse1" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse1" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse1">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse2" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse2" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse2" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse2" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse2" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse2">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse3" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse3" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse3" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse3" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse3" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse3">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse4" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse4" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse4" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse4" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse4" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse4">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse5" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse5" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse5" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse5" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse5" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse5">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse6" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse6" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse6" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse6" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse6" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse6">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse7" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse7" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse7" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse7" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse7" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse7">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse8" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse8" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse8" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse8" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse8" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse8">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse9" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse9" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse9" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse9" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse9" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse9">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse10" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse10" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse10" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse10" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse10" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse10">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse11" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse11" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse11" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse11" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse11" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- <template name="wxParse11">
- <block :wx:if="item.node == 'element'">
- <block :wx:if="item.tag == 'button'">
- <button type="default" size="mini">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse12" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </button>
- </block>
- <block :wx:elif="item.tag == 'li'">
- <view :class="item.classStr + ' wxParse-li'">
- <view :class="item.classStr + ' wxParse-li-inner'">
- <view :class="item.classStr + ' wxParse-li-text'"><view :class="item.classStr + ' wxParse-li-circle'"></view></view>
- <view :class="item.classStr + ' wxParse-li-text'">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse12" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </view>
- </view>
- </block>
- <block :wx:elif="item.tag == 'video'">
- <!-- <template is="wxParseVideo" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'img'">
- <!-- <template is="wxParseImg" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- <block :wx:elif="item.tag == 'a'">
- <view @tap="wxParseTagATap" :class="'wxParse-inline ' + item.classStr + ' wxParse-' + item.tag" :data-src="item.attr.href" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse12" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.tagType == 'block'">
- <view :class="item.classStr + ' wxParse-' + item.tag" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse12" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <view wx:else :class="item.classStr + ' wxParse-' + item.tag + ' wxParse-' + item.tagType" :style="item.styleStr">
- <block :wx:for="item.nodes" wx:for-item="item" wx:key="key">
- <!-- <template is="wxParse12" :data="item"/> -->
- <mp-html :content="item"></mp-html>
- </block>
- </view>
- </block>
- <block :wx:elif="item.node == 'text'">
- <!-- parse <template is="WxEmojiView" :data="item"/> -->
- <block name="WxEmojiView" v-if="false">
- <view class="WxEmojiView wxParse-inline" :style="item.styleStr">
- <block :wx:for="item.textArray" wx:key="key">
- <block :class="item.text == '\\n' ? 'wxParse-hide' : ''" :wx:if="item.node == 'text'">{{ item.text }}</block>
- <block :wx:elif="item.node == 'element'"><image class="wxEmoji" :src="item.baseSrc + item.text" /></block>
- </block>
- </view>
- </block>
- </block>
- </template>
- </view>
- </template>
- <script>
- /**
- * author: Di (微信小程序开发工程师)
- * organization: WeAppDev(微信小程序开发论坛)(http://weappdev.com)
- * 垂直微信小程序开发交流社区
- *
- * github地址: https://github.com/icindy/wxParse
- *
- * for: 微信小程序富文本解析
- * detail : http://weappdev.com/t/wxparse-alpha0-1-html-markdown/184
- */
- /**
- * utils函数引入
- **/
- import showdown from './showdown.js';
- import HtmlToJson from './html2json.js';
- /**
- * 配置及公有属性
- **/
- /**
- * 主函数入口区
- **/
- function wxParse(bindName = 'wxParseData', type = 'html', data = '<div class="color:red;">数据不能为空</div>', target, imagePadding) {
- var that = target;
- var transData = {}; //存放转化后的数据
- if (type == 'html') {
- transData = HtmlToJson.html2json(data, bindName);
- // console.log(JSON.stringify(transData, ' ', ' '));
- } else if (type == 'md' || type == 'markdown') {
- var converter = new showdown.Converter();
- var html = converter.makeHtml(data);
- transData = HtmlToJson.html2json(html, bindName);
- // console.log(JSON.stringify(transData, ' ', ' '));
- }
- transData.view = {};
- transData.view.imagePadding = 0;
- if (typeof imagePadding != 'undefined') {
- transData.view.imagePadding = imagePadding;
- }
- var bindData = {};
- bindData[bindName] = transData;
- that.setData(bindData);
- that.wxParseImgLoad = wxParseImgLoad;
- that.wxParseImgTap = wxParseImgTap;
- }
- // 图片点击事件
- function wxParseImgTap(e) {
- var that = this;
- var nowImgUrl = e.target.dataset.src;
- var tagFrom = e.target.dataset.from;
- if (typeof tagFrom != 'undefined' && tagFrom.length > 0) {
- wx.previewImage({
- current: nowImgUrl,
- // 当前显示图片的http链接
- urls: that[tagFrom].imageUrls // 需要预览的图片http链接列表
- });
- }
- }
- /**
- * 图片视觉宽高计算函数区
- **/
- function wxParseImgLoad(e) {
- var that = this;
- var tagFrom = e.target.dataset.from;
- var idx = e.target.dataset.idx;
- if (typeof tagFrom != 'undefined' && tagFrom.length > 0) {
- calMoreImageInfo(e, idx, that, tagFrom);
- }
- }
- // 假循环获取计算图片视觉最佳宽高
- function calMoreImageInfo(e, idx, that, bindName) {
- var temData = that.data[bindName];
- if (temData.images.length == 0) {
- return;
- }
- var temImages = temData.images;
- //因为无法获取view宽度 需要自定义padding进行计算,稍后处理
- var recal = wxAutoImageCal(e.detail.width, e.detail.height, that, bindName);
- temImages[idx].width = recal.imageWidth;
- temImages[idx].height = recal.imageheight;
- temData.images = temImages;
- var bindData = {};
- bindData[bindName] = temData;
- that.setData(bindData);
- }
- // 计算视觉优先的图片宽高
- function wxAutoImageCal(originalWidth, originalHeight, that, bindName) {
- //获取图片的原始长宽
- var windowWidth = 0;
- var windowHeight = 0;
- var autoWidth = 0;
- var autoHeight = 0;
- var results = {};
- wx.getSystemInfo({
- success: function (res) {
- var padding = that.data[bindName].view.imagePadding;
- windowWidth = res.windowWidth - 2 * padding;
- windowHeight = res.windowHeight;
- //判断按照那种方式进行缩放
- // console.log("windowWidth" + windowWidth);
- if (originalWidth > windowWidth) {
- //在图片width大于手机屏幕width时候
- autoWidth = windowWidth;
- // console.log("autoWidth" + autoWidth);
- autoHeight = (autoWidth * originalHeight) / originalWidth;
- // console.log("autoHeight" + autoHeight);
- results.imageWidth = autoWidth;
- results.imageheight = autoHeight;
- } else {
- //否则展示原来的数据
- results.imageWidth = originalWidth;
- results.imageheight = originalHeight;
- }
- }
- });
- return results;
- }
- function wxParseTemArray(temArrayName, bindNameReg, total, that) {
- var array = [];
- var temData = that.data;
- var obj = null;
- for (var i = 0; i < total; i++) {
- var simArr = temData[bindNameReg + i].nodes;
- array.push(simArr);
- }
- temArrayName = temArrayName || 'wxParseTemArray';
- obj = JSON.parse('{"' + temArrayName + '":""}');
- obj[temArrayName] = array;
- that.setData(obj);
- }
- /**
- * 配置emojis
- *
- */
- function emojisInit(reg = '', baseSrc = '/wxParse/emojis/', emojis) {
- HtmlToJson.emojisInit(reg, baseSrc, emojis);
- }
- module.exports = {
- wxParse: wxParse,
- wxParseTemArray: wxParseTemArray,
- emojisInit: emojisInit
- };
- </script>
- <style>
- .wxParse {
- margin: 0 5px;
- font-family: Helvetica, sans-serif;
- font-size: 28rpx;
- color: #666;
- line-height: 1.8;
- }
- view {
- word-break: break-all;
- overflow: auto;
- }
- .wxParse-inline {
- display: inline;
- margin: 0;
- padding: 0;
- }
- .wxParse-div {
- margin: 0;
- padding: 0;
- }
- .wxParse-h1 {
- font-size: 2em;
- margin: 0.67em 0;
- }
- .wxParse-h2 {
- font-size: 1.5em;
- margin: 0.75em 0;
- }
- .wxParse-h3 {
- font-size: 1.17em;
- margin: 0.83em 0;
- }
- .wxParse-h4 {
- margin: 1.12em 0;
- }
- .wxParse-h5 {
- font-size: 0.83em;
- margin: 1.5em 0;
- }
- .wxParse-h6 {
- font-size: 0.75em;
- margin: 1.67em 0;
- }
- .wxParse-h1 {
- font-size: 18px;
- font-weight: 400;
- margin-bottom: 0.9em;
- }
- .wxParse-h2 {
- font-size: 16px;
- font-weight: 400;
- margin-bottom: 0.34em;
- }
- .wxParse-h3 {
- font-weight: 400;
- font-size: 15px;
- margin-bottom: 0.34em;
- }
- .wxParse-h4 {
- font-weight: 400;
- font-size: 14px;
- margin-bottom: 0.24em;
- }
- .wxParse-h5 {
- font-weight: 400;
- font-size: 13px;
- margin-bottom: 0.14em;
- }
- .wxParse-h6 {
- font-weight: 400;
- font-size: 12px;
- margin-bottom: 0.04em;
- }
- .wxParse-h1,
- .wxParse-h2,
- .wxParse-h3,
- .wxParse-h4,
- .wxParse-h5,
- .wxParse-h6,
- .wxParse-b,
- .wxParse-strong {
- font-weight: bolder;
- }
- .wxParse-i,
- .wxParse-cite,
- .wxParse-em,
- .wxParse-var,
- .wxParse-address {
- font-style: italic;
- }
- .wxParse-pre,
- .wxParse-tt,
- .wxParse-code,
- .wxParse-kbd,
- .wxParse-samp {
- font-family: monospace;
- }
- .wxParse-pre {
- white-space: pre;
- }
- .wxParse-big {
- font-size: 1.17em;
- }
- .wxParse-small,
- .wxParse-sub,
- .wxParse-sup {
- font-size: 0.83em;
- }
- .wxParse-sub {
- vertical-align: sub;
- }
- .wxParse-sup {
- vertical-align: super;
- }
- .wxParse-s,
- .wxParse-strike,
- .wxParse-del {
- text-decoration: line-through;
- }
- .wxParse-strong,
- wxParse-s {
- display: inline;
- }
- .wxParse-a {
- color: deepskyblue;
- word-break: break-all;
- overflow: auto;
- }
- .wxParse-video {
- text-align: center;
- margin: 10px 0;
- }
- .wxParse-video-video {
- width: 100%;
- }
- .wxParse-img {
- background-color: #efefef;
- overflow: hidden;
- width: 40px;
- height: 40px;
- }
- .wxParse-blockquote {
- margin: 0;
- padding: 10px 0 10px 5px;
- font-family: Courier, Calibri, '宋体';
- background: #f5f5f5;
- border-left: 3px solid #dbdbdb;
- }
- .wxParse-code,
- .wxParse-wxxxcode-style {
- display: inline;
- background: #f5f5f5;
- }
- .wxParse-ul {
- margin: 20rpx 10rpx;
- }
- .wxParse-li,
- .wxParse-li-inner {
- display: flex;
- align-items: baseline;
- margin: 10rpx 0;
- }
- .wxParse-li-text {
- align-items: center;
- line-height: 20px;
- }
- .wxParse-li-circle {
- display: inline-flex;
- width: 5px;
- height: 5px;
- background-color: #333;
- margin-right: 5px;
- }
- .wxParse-li-square {
- display: inline-flex;
- width: 10rpx;
- height: 10rpx;
- background-color: #333;
- margin-right: 5px;
- }
- .wxParse-li-ring {
- display: inline-flex;
- width: 10rpx;
- height: 10rpx;
- border: 2rpx solid #333;
- border-radius: 50%;
- background-color: #fff;
- margin-right: 5px;
- }
- .wxParse-u {
- text-decoration: underline;
- }
- .wxParse-hide {
- display: none;
- }
- .WxEmojiView {
- align-items: center;
- }
- .wxEmoji {
- width: 16px;
- height: 16px;
- }
- .wxParse-tr {
- display: flex;
- border-right: 1px solid #e0e0e0;
- border-bottom: 1px solid #e0e0e0;
- }
- .wxParse-th,
- .wxParse-td {
- flex: 1;
- padding: 5px;
- font-size: 28rpx;
- border-left: 1px solid #e0e0e0;
- word-break: break-all;
- }
- .wxParse-td:last {
- border-top: 1px solid #e0e0e0;
- }
- .wxParse-th {
- background: #f0f0f0;
- border-top: 1px solid #e0e0e0;
- }
- @import '@/lib/wxParse/wxParse.ttss';
- </style>
|