GithubHelp home page GithubHelp logo

vue-function-api's People

Contributors

antfu avatar liximomo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vue-function-api's Issues

value(null) will error out

When putting null in a value wrapper, this error will be thrown:

TypeError: "can't convert null to object"
    upWrapping vue-function-api.module.js:336
    value vue-function-api.module.js:353
    setup CodeSandbox.vue:45
    mergedSetupFn vue-function-api.module.js:273
    vuexInit vue-function-api.module.js:302

Here is an example code:

import { value } from 'vue-function-api'

export default {
  setup () {
    return { error: value(null) }
  }
}

SFC support

Hello and thanks for your work.

I was wondering about the SFC support. Currently it seems there is a binding issue (Property or method "msg" is not defined on the instance but referenced during render).
I tested with:

<template>
  <h1>{{ msg }}</h1>
</template>

<script lang="ts">
import Vue from "vue";
import { value } from "vue-function-api";

export default Vue.extend({
  setup() {
    const msg = value("Hello World!");

    return { msg };
  }
});
</script>

TypeError: Cannot read property 'refs' of undefined

It doesn't look like the second parameter 'context' is defined. The custom hooks are irrelevant to the issue, but this is how I am using them.

This is my code:

setup(props, context) {
  const message = value("Hello Vue in CodeSandbox!");
  const messageUppercase = computed(() => message.value.toUpperCase());

  useKeypress("j", () => {
    console.log("clicked!");
  });

  useElementKeypress("u", context.refs.elementKeypress, () => {
    console.log("clicked!");
  });

  return { message, messageUppercase };
}

English README

Adding English README can make the project reachable for more people.

I can do some help if needed.

README.md 文件錯誤

下方文件的部分寫
import { plugin, value, computed, watch, onMounted } from 'vue-class-component'
但是應該是
import { plugin, value, computed, watch, onMounted } from 'vue-function-api'

We would love to adopt this package!

Hi @liximomo - thank you very much for working on this package, something we wish we had when the RFC thread blew up.

We are considering adopting this package to serve as the official 2.x function API plugin, and in the process you are welcome to join the core team. There are still a few changes to the RFC we are considering, and would love to work with you to see that reflected in this package. Would you be interested?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.