kazzkiq / CodeFlask

A micro code-editor for awesome web pages.
https://kazzkiq.github.io/CodeFlask/
MIT License
1.07k stars 121 forks source link

Code lines is not completely loading on init #96

Open mpz opened 5 years ago

mpz commented 5 years ago

On loading I have: image

After pressing Enter or any code changes:

image

Code lines appeared!

Need load lines on init

mpz commented 5 years ago

my Fix

initFlask(code){
    if(!this.flask){
      this.flask = new CodeFlask('.code', { language: 'js', lineNumbers: true });
      this.flask.onUpdate((code) => {
        this.new_code = code;
      });
    }

      this.flask.updateCode(code);
      this.flask.setLineNumber();   // manualy update lines
  }
huanglei890714 commented 3 years ago

my Fix

initFlask(code){
    if(!this.flask){
      this.flask = new CodeFlask('.code', { language: 'js', lineNumbers: true });
      this.flask.onUpdate((code) => {
        this.new_code = code;
      });
    }

      this.flask.updateCode(code);
      this.flask.setLineNumber();   // manualy update lines
  }

I wrote it like your, but it doesn't work

huanglei890714 commented 3 years ago

my Fix

initFlask(code){
    if(!this.flask){
      this.flask = new CodeFlask('.code', { language: 'js', lineNumbers: true });
      this.flask.onUpdate((code) => {
        this.new_code = code;
      });
    }

      this.flask.updateCode(code);
      this.flask.setLineNumber();   // manualy update lines
  }

I wrote it like your, but it doesn't work

I solved it, because of the problem of passing parameters,the parameters can only be strings