Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复在ul上设置内联list-style-type:none不生效的问题 #124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions wxParse/html2json.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ function html2json(html, bindName) {
// make it array of attribute
if (name == 'style') {
console.dir(value);
// fixed cannot set inline style of 'list-style-type: none' of ul
if (value.indexOf('list-style-type: none') !== -1 && tag === 'ul') node.noListStyleClass = 'wxParse-no-li-style';
// value = value.join("")
node.styleStr = value;
}
Expand Down
2 changes: 1 addition & 1 deletion wxParse/wxParse.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

<!--其他块级标签-->
<block wx:elif="{{item.tagType == 'block'}}">
<view class="{{item.classStr}} wxParse-{{item.tag}}" style="{{item.styleStr}}">
<view class="{{item.classStr}} {{item.noListStyleClass}} wxParse-{{item.tag}}" style="{{item.styleStr}}">
<block wx:for="{{item.nodes}}" wx:for-item="item" wx:key="">
<template is="wxParse1" data="{{item}}"/>
</block>
Expand Down
6 changes: 6 additions & 0 deletions wxParse/wxParse.wxss
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ view{
line-height: 20px;
}

.wxParse-no-li-style .wxParse-li-circle,
.wxParse-no-li-style .wxParse-li-square,
.wxParse-no-li-style .wxParse-li-ring,{
display: none;
}

.wxParse-li-circle{
display: inline-flex;
width: 5px;
Expand Down