导航

    Taro 社区

    Taro

    • 注册
    • 登录
    • 搜索
    • 版块
    • 最新
    • 话题
    • 热门
    • 群组
    1. 主页
    2. jd_zAzJHnAsBzkG
    J
    • 资料
    • 关注
    • 粉丝
    • 主题
    • 帖子
    • 最佳
    • 群组

    jd_zAzJHnAsBzkG

    @jd_zAzJHnAsBzkG

    0
    声望
    4
    帖子
    809
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    jd_zAzJHnAsBzkG 关注

    jd_zAzJHnAsBzkG 发布的帖子

    • image touch无效

      想实现一个简单的图片裁剪功能,但是图片onTouchStart没有被调用,但是下面的view是又被调用的。是因为image标签无法使用onTouch的事件监控吗

      import Taro  from '@tarojs/taro';
      import React, { useEffect, useImperativeHandle } from 'react';
      import { View, Canvas, Image } from '@tarojs/components';
      import "./index.scss";
      
      interface ImageCropperPropsType {
      	imgSrc,
      	cut_ratio?: 1, //裁剪框的 宽/高 比
      }
      const ImageCropper: React.FC <ImageCropperPropsType> = props => {
      
      	const { imgSrc, cut_ratio } = props
      
      	useEffect(() => {
      
      	})
      
      	const handleTouch = (e) =>{
      		console.log('e', e);
      	}
      	const handleClick = (e) => {
      		console.log('click', e);
      	}
      
      	return (
      		<View
      			className='cut_wrapper'
      			>
      		<Image
      			className='img'
      			src={imgSrc}
      			onTouchStart={handleTouch.bind(this)}
      			/>
      			<View onTouchStart={handleTouch.bind(this)}>
      				ghhgdf
      			</View>
      		</View>
      	)
      }
      
      export default ImageCropper;
      
      发布在 微信小程序
      J
      jd_zAzJHnAsBzkG
    • taro如何渲染富文本
       const string = '## header'
       <View className='course-anlist-item-content' dangerouslySetInnerHTML={{__html: string}} />
      

      渲染失败

      发布在 Taro
      J
      jd_zAzJHnAsBzkG
    • taro如何渲染markdown编辑器编辑的文字

      通过<RichText>渲染出来的效果存在很多修饰语,有什么方法可以解决
      #!/system/markdown↵↵# h1 Heading 8-)↵↵↵## h2 Heading↵### h3 Heading↵#### h4 Heading↵##### h5 Heading↵###### h6 Heading![]↵↵↵## Horizontal Rules↵↵___↵↵---↵↵↵↵↵## Typographic replacements↵↵Enable typographer option to see result.↵↵(c) (C) (r) (R) (tm) (TM) (p) (P) +-↵↵test.. test... test..... test?..... test!....↵↵!!!!!! ???? ,, -- ---↵↵"Smartypants, double quotes" and 'single quotes'↵↵↵## Emphasis↵↵This is bold text*↵↵__This is bold text__↵↵This is italic text↵↵_This is italic text_↵↵Strikethrough↵↵↵## Blockquotes↵↵> Blockquotes test↵ - nest↵> Blockquotes can also be nested...↵>> ...by using additional greater-than signs right next to each other...↵> > > ...or with spaces between arrows.↵↵↵## Lists↵↵Unordered↵↵+ Create a list by starting a line with +, -, or *↵+ Sub-lists are made by indenting 2 spaces:↵ - Marker character change forces new list start:↵ * Ac tristique libero volutpat at↵ + Facilisis in pretium nisl aliquet↵ - Nulla volutpat aliquam velit↵+ Very easy!↵↵Ordered↵↵1. Lorem ipsum dolor sit amet↵2. Consectetur adipiscing elit↵3. Integer molestie lorem at massa↵↵↵1. You can use sequential numbers...↵1. ...or keep all the numbers as 1.↵↵Start numbering with offset:↵↵57. foo↵1. bar↵↵↵## Code↵↵Inline code↵↵Indented code↵↵ // Some comments↵ line 1 of code↵ line 2 of code↵ line 3 of code↵↵↵Block code "fences"↵↵↵Sample text here...↵↵![]

      发布在 Taro 实践 + 案例
      J
      jd_zAzJHnAsBzkG