index.tsx 697 B

12345678910111213141516171819202122232425262728293031
  1. import Taro, { useLoad } from '@tarojs/taro'
  2. import React from 'react'
  3. import { View } from '@tarojs/components'
  4. import Demo from '@/pages/components/demo/index'
  5. import './index.less'
  6. // console.log(Demo)
  7. // debugger
  8. const myPluginInterface = Taro.requirePlugin('myPlugin')
  9. const Index: React.FC = () => {
  10. useLoad(() => {
  11. myPluginInterface.sayHello()
  12. const answer = myPluginInterface.answer
  13. console.log('answer: ', answer)
  14. })
  15. function hasCllick() {
  16. console.log('hasCllick')
  17. }
  18. return (
  19. <View className='index'>
  20. {/* <Demo width="123"></Demo> */}
  21. <custom width="1000" props={{width: "300"}} onClick={hasCllick}/>
  22. </View>
  23. )
  24. }
  25. export default Index