@danylo_kiz

Почему проблема?

Вот проблема. Все есть, но в консоле пишет проблемы. Не могу понять какие, скажите.
<div class="container content">
			<div class="row">
				<div  class="col-sm-8 col-sm-offset-2">
					<div id="one" class="text-left list-inline">
						<h3 class="text-primary"><img class="img-rounded" src="macbook-gifka.gif" width="70" height="60">When is the best time to buy Macbook?</h3>
						<hr>
						<p>{{short}}</p>
						<button class="btn btn-default"><a href="./macbook-more1.html">More</a></button>
					</div>
					<hr>
					<div class="text-inline text-left">
						<h3 class="text-danger">Internet Shops With International Delivery And Cheap Prices</h3>
						<hr>
						<ol>
							<b>
								<li v-for="site is cheapsites.thecheapestsites">{{site[0]}}</li>
								<li>{{site[1]}}</li>
								<li>{{site[2]}}</li>
								<li>{{site[3]}}</li>
								<li>{{site[4]}}</li>
								<li>{{site[5]}}</li>
							</b>
						</ol>
						<button class="btn btn-default"><a href="./cheap-sites-eng.html">More</a></button>
					</div>
				</div>
			</div>
		</div>
	</body>
	<div>
		<script type="text/javascript">
			new Vue({
				el: "#cheapestsites",
				data: {
					cheapsites: []
				},
				mounted(){
					fetch("http://danya.loc/all.json").then(c => c.json()).then((data) => {
						this.cheapsites = data;
					})
				}
			})
		</script>
		<script type="text/javascript">
			new Vue({
  				src: "./all.json",
  				el: "#one",
  				data: {
    				short: "Generally, most people prefe..."
  				}
			})
 	 	</script>
 	</div>

JSON
[
	{
		"macfulleng": "As a rule, most people prefer to bu, Apple will rarely deviate from this path.",
		"macfullrus": "Как правило, большинство людейяться от этого пути.",
		"macbookfullimg": "./macbook-img.jpg",
		"macbookshortimg": "./macbook-gifka.gif",
		"thecheapestsites": ["AliExpress", "TheHut", "Sheinside", "BookDepository", "DealeXtreme", "599fashion", "ShortsDirect", "Ebay", "Amazon", "OLX"]
	}
		
]

И {{site}} не выводит.
8a5f5fffe2be45b7b503c4021e5d53fc.png

Консоль 977abda32c7c48b99f79c3041950bfdc.png
  • Вопрос задан
  • 342 просмотра
Пригласить эксперта
Ответы на вопрос 3
Fragster
@Fragster
помогло? отметь решением!
<b>
                <li v-for="site in cheapsites.thecheapestsites">{{site}}</li>
              </b>
Ответ написан
@Stepanya
попробуте так:
<script type="text/javascript">
window.onload = function () {
ew Vue({
        el: "#cheapestsites",
        data: {
          cheapsites: []
        },
        mounted(){
          fetch("http://danya.loc/all.json").then(c => c.json()).then((data) => {
            this.cheapsites = data;
          })
        }
      });
      new Vue({
  	src: "./all.json",
  	el: "#one",
  	data: {
    	  short: "Generally, most people prefe..."
        }
      })
}
</script>
Ответ написан
@sergeos
очевидно, что не объявлен div с id="cheapestsites", судя по коду:
el: "#cheapestsites",
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы