Code Monkey home page Code Monkey logo

Comments (11)

cemarta7 avatar cemarta7 commented on August 21, 2024

On main.js after Framework7.use(Framework7Vue); add

Framework7.use(Framework7Keypad);

Then in your page

<f7-list-input
	input-id="credit_card"
	label="Card Number"
	type="numpad"
	placeholder=""
	 clear-button
	required
	@change="changeCardNumber()"
	@input="new_card.card_number = $event.target.value"
></f7-list-input>

changeCardNumber(){
	var self=this;
	this.new_card.card_number=this.$f7.keypad.get().value
},

That's how I got it to work.

from framework7-plugin-keypad.

cepm-nate avatar cepm-nate commented on August 21, 2024

I'm using Vue and F7 as well, yet rendering the input using , no F7 involved.

In main.js I have

import Framework7Keypad from 'framework7-plugin-keypad';
Framework7.use(Framework7Keypad);

And in my module, when I call this.$f7.keypad.create({inputEl: 'input.qty'}), I get Class constructor Framework7Class cannot be invoked without 'new'.

TypeError: Class constructor Framework7Class cannot be invoked without 'new'
    at new Keypad (framework7-keypad.js?d830:22)
    at new create (framework7-keypad.js?d830:863)

... I'm hunting for solutions and will report back.

from framework7-plugin-keypad.

pedrohenriquerissato avatar pedrohenriquerissato commented on August 21, 2024

Same problem as the others.

Installed with:
npm install framework7-plugin-keypad

Instantiated in main:

import Framework7Keypad from 'framework7-plugin-keypad';  
Framework7.use(Framework7Keypad);

And finally, created the component:

<f7-list-input
	input-id="credit_card"
	label="Card Number"
	type="numpad"
	placeholder=""
	required
></f7-list-input>

Got the same error as @cepm-nate :
"[Vue warn]: Error in updated hook: "TypeError: Class constructor Framework7Class cannot be invoked without 'new'"

from framework7-plugin-keypad.

cemarta7 avatar cemarta7 commented on August 21, 2024

Can you guys try to do the import like this

import Framework7Keypad from 'framework7-plugin-keypad/dist/framework7.keypad.js';

Framework7.use(Framework7Vue);
Framework7.use(Framework7Keypad);//<- after importing framework7vue

Also, which version of framework7 are you using?

then in template

<f7-list-input
                            input-id="cvv"
                            label="CVV"
                            type="numpad" 
                            placeholder=""
                            clear-button
                            required
                            @change="changeCVV()"
                            @input="new_card.cvv = $event.target.value"
                    ></f7-list-input>

type="numpad"

@cepm-nate
@pedrohenriquerissato

from framework7-plugin-keypad.

pedrohenriquerissato avatar pedrohenriquerissato commented on August 21, 2024

Can you guys try to do the import like this
import Framework7Keypad from 'framework7-plugin-keypad/dist/framework7.keypad.js';

Framework7.use(Framework7Vue);
Framework7.use(Framework7Keypad);//<- after importing framework7vue

Also, which version of framework7 are you using?
then in template
<f7-list-input
input-id="cvv"
label="CVV"
type="numpad"
placeholder=""
clear-button
required
@change="changeCVV()"
@input="new_card.cvv = $event.target.value"
>

type="numpad"
@cepm-nate
@pedrohenriquerissato

There was a typo in:

import Framework7Keypad from 'framework7-plugin-keypad/dist/framework7.keypad.js';

Should be:

import Framework7Keypad from 'framework7-plugin-keypad/dist/framework7-keypad.js';

But, unfortunately same error was generated:

vue.esm.js?efeb:628 [Vue warn]: Error in updated hook: "TypeError: Class constructor Framework7Class cannot be invoked without 'new'"

found in

---> <F7View>
       <F7App>
         <App> at src/App.vue
           <Root>
TypeError: Class constructor Framework7Class cannot be invoked without 'new'
    at new Keypad (framework7-keypad.js?43df:22)
    at Object.create (framework7-keypad.js?43df:863)
    at HTMLInputElement.eval (framework7-keypad.js?43df:903)
    at Dom7.each (dom7.module.js?4419:610)
    at Framework7.pageInit (framework7-keypad.js?43df:895)
    at eval (class.js?c95a:90)
    at Array.forEach (<anonymous>)
    at eval (class.js?c95a:89)
    at Array.forEach (<anonymous>)
    at Framework7.emit (class.js?c95a:83)

I'm using this versions:

"framework7": "^3.5.1",
"framework7-plugin-keypad": "^3.0.1",
"framework7-vue": "^3.5.1",

from framework7-plugin-keypad.

cemarta7 avatar cemarta7 commented on August 21, 2024

This is my version:

        "framework7": "^3.6.5",
        "framework7-icons": "^2.1.1",
        "framework7-plugin-keypad": "^2.0.0",
        "framework7-vue": "^3.6.5",

3.0.1 requires "framework7": "^5.0.5"

https://github.com/framework7io/framework7-plugin-keypad/blob/v3.0.1/package.json

downgrade "framework7-plugin-keypad" to "^2.0.0" or upgrade to framework7 5.

from framework7-plugin-keypad.

pedrohenriquerissato avatar pedrohenriquerissato commented on August 21, 2024

This is my version:
"framework7": "^3.6.5",
"framework7-icons": "^2.1.1",
"framework7-plugin-keypad": "^2.0.0",
"framework7-vue": "^3.6.5",

3.0.1 requires "framework7": "^5.0.5"
https://github.com/framework7io/framework7-plugin-keypad/blob/v3.0.1/package.json
downgrade "framework7-plugin-keypad" to "^2.0.0" or upgrade to framework7 5.

Upgraded framework7 to 5.0.5 and got the same error. Downgraded keypad to 2.0.0 and error was gone, but nothing was being done, maybe syntax changed trough this versions? Still trying to figure out why updating f7 didn't quit the error. Maybe some other package is interfering, like webpack.... idk.

from framework7-plugin-keypad.

cepm-nate avatar cepm-nate commented on August 21, 2024

Here is my version:

    "framework7": "^5.0.5",
    "framework7-icons": "^3.0.0",
    "framework7-plugin-keypad": "^3.0.1",
    "framework7-vue": "^5.0.5",

I'm importing like such:

import Vue from 'vue';
import Framework7 from 'framework7/framework7-lite.esm.bundle';
import Framework7Vue from 'framework7-vue/framework7-vue.esm.bundle';
import Framework7Keypad from 'framework7-plugin-keypad/dist/framework7-keypad';
...
Framework7.use(Framework7Vue);
Framework7.use(Framework7Keypad);

I still get the same error:

Uncaught TypeError: Class constructor Framework7Class cannot be invoked without 'new'
    at new Keypad (framework7-keypad.js?d830:22)
    at Object.create (framework7-keypad.js?d830:863)
    at <anonymous>:1:26

when executing app.$f7.keypad.create()
Would seeing my babel or other configs help?

from framework7-plugin-keypad.

Tarekajaj avatar Tarekajaj commented on August 21, 2024

Don't know if this is related, I was getting an error when trying to use the plugin, and importing it like the following fixed my error:

import 'framework7-plugin-keypad/dist/framework7-keypad.js';

from framework7-plugin-keypad.

olegdater avatar olegdater commented on August 21, 2024

same here with framework7 v5 and keyboard plugin 3.x
tried
import Framework7Keypad from 'framework7-plugin-keypad/dist/framework7-keypad.js';
with no avail

from framework7-plugin-keypad.

sirg2003 avatar sirg2003 commented on August 21, 2024

For anybody having troubles. Try this:

import Framework7Keypad from 'framework7-plugin-keypad/src/framework7-keypad.js';
import 'node_modules/framework7-plugin-keypad/src/framework7-keypad.less';

from framework7-plugin-keypad.

Related Issues (20)

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.