Make Text Editable/ReadOnly Based on Input using Vue Js










0















I am trying to achieve something where in a given input I make the string editable or non editable(readonly) based on the context of the text in vue js.



For example :
I have a text: My Name is $John Doe$
Now my vue js code should iterate the string and the text between $ can be editable.



HTML:
<template>
<textarea cols="10" rows="10" disabled> makeTextEditableByCondition</textarea>
<input type="text" v-model="editText">
</template>
<script>
export default {
data()
q : "My name is $John Doe$ from NYC,
editText: null,
disabled: true

filters:{
makeTextEditableByCondition(text)
let splittedText = text.split("$");
let this.editText = splittedText[1]
splittedText.splice(1,1)
return splittedText.join(" ")

</script>


But It's still making the process complicated and I am not achieveing proper output.



Any help will be hightly appreciated










share|improve this question




























    0















    I am trying to achieve something where in a given input I make the string editable or non editable(readonly) based on the context of the text in vue js.



    For example :
    I have a text: My Name is $John Doe$
    Now my vue js code should iterate the string and the text between $ can be editable.



    HTML:
    <template>
    <textarea cols="10" rows="10" disabled> makeTextEditableByCondition</textarea>
    <input type="text" v-model="editText">
    </template>
    <script>
    export default {
    data()
    q : "My name is $John Doe$ from NYC,
    editText: null,
    disabled: true

    filters:improve this question























      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Nov 13 '18 at 6:57









      SephyreSephyre

      394




      394





























          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274288%2fmake-text-editable-readonly-based-on-input-using-vue-js%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

          Edmonton

          Crossroads (UK TV series)