-
Notifications
You must be signed in to change notification settings - Fork 4
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
不好用,但是如果我把代码更新了,把block删了换成View,又没样式,大佬,要不您说说咋解决样式的事得了 #3
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import Taro from '@tarojs/taro'
import React, {useEffect, useState} from 'react';
import {View, Text, Image, Video} from '@tarojs/components'
import "./taro-wemark.css"
import Remarkable from "./remarkable"
let parser = new Remarkable({
html: true
});
export default (props) => {
const [renderList, setRenderList] = useState();
useEffect(() => {
if (props.md) {
setRenderList(parse(props.md))
}
}, [props.md])
const parse = (md, options) => {
}
return (
![]({renderInline.src})
{
renderList instanceof Array && renderList.length > 0 && renderList.map((renderBlock) => {
console.log('renderBlock', renderBlock);
return (<View className={'wemark_block_' + renderBlock.type} key={renderBlock.blockIndex}>
{
renderBlock.isArray &&
renderBlock.content.map((renderInline) =>
{
renderInline.type !== 'image' ?
<Text className={'wemark_inline_' + renderInline.type}>{renderInline.content}
:
}
)
}
{
!renderBlock.isArray && renderBlock.type === 'code' && {renderBlock.content}
}
{
!renderBlock.isArray && renderBlock.type === 'video' &&
}
)
}
)
}
)
}
这代码被我改成这样了,因为你那个Taro.Component不好使,而且不是函数式的话你上来它小程序第一次constructor里面不激活componentwillreceiveprops,然后我也不想动constructor,所以就改成函数式了,然后现在就面临着没样式的问题。
![image](https://private-user-images.githubusercontent.com/58804959/254840071-e6f7b072-9ba1-4741-a19f-bd087edb042d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA3OTgyODYsIm5iZiI6MTcyMDc5Nzk4NiwicGF0aCI6Ii81ODgwNDk1OS8yNTQ4NDAwNzEtZTZmN2IwNzItOWJhMS00NzQxLWExOWYtYmQwODdlZGIwNDJkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEyVDE1MjYyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBmNWNhNjA0YjQyZDRlODEwZDJjZjNkMDc1MTc0OGIyNTNjZTM5YWMyOGI2MjY4MDVkMDBlNzhjMjhkMWEzYjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gKZ315ct53QUXsB247cQVPg8lRVgDIFWMZfP5h_2X_Q)
实在是太白辣!!!!!!!!!!!!!!!!!!!!!!!!!!!!
大佬咋整啊啊
The text was updated successfully, but these errors were encountered: