0

How can I make the following code work with Vue.js?

<a href="http://{{ company }}.com">Google</a>

where company is google.

data: {
   company: "google"
}
0

1 Answer 1

4

const app = new Vue({
  el: '#app',
  data() {
    return {
      company: 'google'
    };
  },

});
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.1/vue.js"></script>
    <div id="app">
      <a :href="`http://${company}.com`">Google</a>
    </div>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.