Vue transfers data to the background render page

clipboard.png
there are two buttons, one is button and the other is form. When I click button, the data is sent to the background, but {{line}} is not rendered, but when I click form"s View details button, {{line}} can render it? Why?
the background code is as follows

@csrf_exempt
def post_data(request):
    if request.method == "GET":
        return render(request, "test.html")
    if request.method =="POST":
        print(request.POST)
        line = {"line":"china"}
        return render(request, "test.html",line)

post the form submission refreshes the page. Go to the template engine in the background


your button executes the test2 function, but the axios in test2 sends a post request and does not process the return value, so the page will not change.

but "View details" that submit, submitted the form directly through post, the page was refreshed, and the line was rendered at the back end.

besides, there is no line in the data of your vue.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be6db4-52eca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be6db4-52eca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?