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

查看 Codepen 示例,报错 #16

Open
turkyden opened this issue Aug 20, 2021 · 1 comment
Open

查看 Codepen 示例,报错 #16

turkyden opened this issue Aug 20, 2021 · 1 comment

Comments

@turkyden
Copy link

turkyden commented Aug 20, 2021

点击查看代码示例后,发现合成的代码有问题,无法预览 :-(

另外,如何开启 CodesandBox 预览呢? @dewfall123

image

new Vue({
	el: '#app', 
	import { useSize } from 'ahooks-vue';
import { ref } from 'vue';

  setup() {
    const divRef = ref(null);
    const size = useSize(divRef, {
      onChange: () => {
        console.log('size change');
      },
    });

    return {
      divRef,
      size,
    };
  },
};
})
@xiaoyao316
Copy link
Contributor

@turkyden 用错了吧。import导入模版的语句怎么能放到new Vue的选项里呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants